I discovered, that I can write `1E5`

or `1e5`

instead of `100000`

. Is there a way to use this operator/method/something with variables? I know I can use `Math.Pow(10, 5);`

, but I wanted to know if this this `E`

works with variables, too.

The E notation is only for constants. `Math.Pow(x, 5)`

is the only built-in way to exponent a variable.

**EDIT**

However, `Math.Pow`

accepts `double`

s and returns a `double`

, so if you want to exponent an integer, you should look at this answer: this answer

The use of "e" as an operator(ish) is restricted to constants only.

If this worked on variables, it would cause havoc...eg:

```
Hello = 10;
H = 1;
llo = 5;
x = Hello
```

Does "x" now equal 10 or 1e5?

`Math.Pow(x,y)`

is your best bet.

You could use the bit shift operator to do something similar:

```
int i = 1;
Console.WriteLine(i << 3); // 8
```

The bitshift operator `<<`

does exactly the same thing as the E in 1E5. Only in base 2, not 10.

The 1E5 notation refers to a numeric value, which, by definition is a value. Your variable might have a numeric value provided that it is of numeric type (like double), but it can change its value (this is why it is called a variable). So, your variable is a placeholder for values, not a value and you cannot use this notation, as it is reserved only for values.

The `e`

is not an operator. Is is part of the real literal syntax of the C# language. It is evaluated when the code is parsed and can only be used to express a constant literal.

Just like you can use suffixes `f`

to denote a float, or `d`

to denote a double, the `XeY`

syntax allows you to *define* doubles with the value `X * 10^Y`

. It’s simply meant as a convenience when you’re writing code with constant numbers.

Here are some more examples on what you can do with all these different syntaxes, and which type and constant literal they are equivalent to:

```
var a = 2e5; // (double) 200000
var b = 2.3e3; // (double) 2300
var c = 13f; // (single) 13
var d = 53d; // (double) 53
var e = 1.2e3f; // (single) 1200
var f = 2.3m; // (decimal) 2.3
var g = 1.23e-4m; // (decimal) 0.000123
```

However, none of that is exposed to the .NET runtime, it is all evaluated at compile time and stored as exposed as constant literals—there is absolutely no difference between the short syntax and the full constant. As such, this functionality is not available for variables which only exist at run-time. If you need to exponentiate those, you will have to use other methods, for example `myVariable * 10e5`

.

Similar Questions

Anyone please help in Creating SecKeyRef from Exponent and Modulus being my Public exponent = 010001 and Public Modulus =008903fb6d15f352ed3b45add3216f632f7139954a5631337aba7d645ed38482e3a810b4db26aab

I'm new to C++, this is my first week since the upgrade from fortran. Sorry if this is a simple question, but could someone help me with operator overloading. I have written a program which has two cl

I want to supply a negative exponent for the scipy.stats.powerlaw routine, e.g. a=-1.5, in order to draw random samples: powerlaw.pdf(x, a) = a * x**(a-1) from scipy.stats import powerlaw R =

I was reading atomsite code, i found this: public static implicit operator XElement(XmlBase xmlBase) { return xmlBase.Xml; } what that means?

I'm using this example for javascript encryption using a key generated with the php openssl library, but $details = openssl_pkey_get_details($resource) is returning no public exponent ($details['rsa']

public static int exponent(int baseNum) { int temp = baseNum *= baseNum; return temp * exponent(baseNum); } Right now the method above does n * n into infinity if I debug it, so it still works but I

The following mantissa and exponents are represented in twos complement form using 8bits each. Mantissa: 10010000 Exponent: 00000001 This is how I tried it, 1.0010000 x 2^1 10.010000 Converting thi

While adding numbers using XSL, it's showing result with exponent. For example, if ProductID is 1111 <xsl:value-of select=@ProductID + 1000000/> It's showing something like 1.1111E6, however

Is there a possible way to find out the modulus and exponent of the Public Key, created with SecKeyGeneratePair (the Security Framework in general)?

I'm trying to do specialization to template operator, the template looks like this: template <typename Iterator1, typename Iterator2> ResultType operator()(Iterator1 a, Iterator2 b, size_t size

I have an RSA encrypted message, the private and public exponent and the modulus. How can i decrypt the message with PHP? The exponents and the modulus are base64_encoded.

This is a possibly silly question, but looking at the mapping of operators to functions I noticed that there is no function to express the not in operator. At first I thought this was probably because

I've been scratching my head all day new to operator overloading and my operator+ function computes the data correctly, but I need to pass the data of temp class to operator= to assign it to a separat

Until now, my understanding was that == is an operator overload for .equals(). However, I recently discovered that new Integer(1) == new Long(1) // returns true whereas new Integer(1).equals(new Long

When overloading operators, is it necessary to overload >= <= and !=? It seems like it would be smart for c++ to call !operator= for !=, !> for operator<= and !< for operator>=. Is t

I know the names of most of the operators but not sure what operator<< and operator>> are called. i.e. operator=() // the assignment operator operator==() // the equality of comparison ope

What does Scala's @ operator do? For example, in the blog post Formal Language Processing in Scala, Part 2 there is a something like this case x @ Some(Nil) => x

I have 3 byte arrays of 128, 128, 3 bytes respectively. I don't know what it is, but I expect them to be Modulus, D, Exponent. Now how to use these arrays in C# to decrypt a byte array using RSA? When

In person.h, under the public section of a class named person, I have this: bool operator < (person& currentPerson); In person.cpp I have this: bool person::operator < (person& currentP

A derives directly from Object class and neither A or Object overload == operator, so why doesn't next code cause an error: class Program { static void Main(string[] args) { A a1 = new A(); A a2 = new

I have been trying to compile this program but it is giving me an error in regards to overloading the * operator for one of the functions: complex operator *(double n)const When I try to compile I get

What are the basic rules and idioms for operator overloading in C++? Note: The answers were given in a specific order, but since many users sort answers according to votes, rather than the time they w

In C++, you cannot overload operator .* Can someone give me an example for the usage of operator .*?

In my text book they give an example of overloading the + operator Sales_item operator+ (const Sales_item& lhs, const Sales_item& rhs) { Sales_item ret(lhs); ret += rhs; return ret; } But whe

I want to get the exponent of a BigDecimal. `1M` (`1E0M`) -> `0` `10M` (`1E1M`) -> `1` `11M` (`1.1E1M`) -> `1` `1E2M` -> `2` `1.0E2M` -> `2` `100M` (`1.00E2M`) -> `2` scale, at leas

I am trying to convert a decimal number (329.39062) to binary (exponent, mentissa). I keep getting segmentation fault. on running the gdb test, It shows me feof. I have changed alot but it keeps showi

The mySql REGEXP operator is not case sensitive. Is there a version of this operator that is case sensitive?

I have a slight problem where my << operator is not being called correctly. This is what I have: class SomeInterface { friend std::ostream& operator<<(std::ostream& str, const Some

Is there is an operator in XPath 1.0 that acts as in operator in SQL? select * from tbl_students where id in (1,2,3)

Is there a way to overload exponents in C#? I know in some languages (can't name any off the top of my head), ^ is used for exponential functions, but in C++ and C#, ^ is the bitwise XOR operator, whi

I've seen some smart pointers implementing operator= in two ways: A) One that assigns the raw pointer to the other raw pointer: SmartPointer& operator=(const SmartPointer& rhs) { delete m_ptr;

Is C++ typeof operator standard? de facto standard? which compilers do not provided it (besides Microsoft C++)?

Suppose two classes with the following implicit and explicit operator pattern: class Foo { public static implicit operator decimal (Foo foo) { throw new NotImplementedException(); } public static impl

In our program we have values around millions to milliards which need to be displayed. Due to user requirements, the users want to see only exponent values which are dividable by 3. means the values t

I'm using cryptopp to generate key pairs and i'm wondering if there is a way to set a default value like 65537 for the public exponent e. GenerateRSAKey(keyLength, privFilename, pubFilename, seed);

Here are an example of operator overloading from C++ programming language: struct X{ int I; X(int); X operator+(int); }; struct Y{ int I; Y(X); Y operator+(X); operator int(); } I am not clear about

Is there a way, using gmplib, to print an mpf_t number without the exponent? I would rather not have to write a function that reads the exponent and moves the decimal manually, as that kind of seems l

I have a large file with numbers in the form of 6,52353753563E-7. So there's an exponent in that string. float() dies on this. While I could write custom code to pre-process the string into something

So in the context of 24-bit floating points, I have a the following question: If I want to modify a floating point by using more or less bits for the exponent. For example, I might want to use 9 bits

For the one millionth time, I would have liked to use an IN operator in Java, similar to the IN operator in SQL. It could just be implemented as compiler syntactic sugar. So this if (value in (a, b, c

I have a program following: class INT { public: INT(int ii = 0) : i(ii) {} operator int() { return i; } private: int i; }; int main() { INT i; cin >> i; } the statement cin >> i is compil

It may be silly question. Is there any way to give comparison operator at runtime using string variable. Suppose i have a data of salaries in vector. vector < int > salary; Input: salary[i] !

The question is if I can find a way to make a parametrized overloading of an operator i.e. instead of template <class T> class A { private: T m_var; public: operator T () const { return m_var;

Which is best practice (in this case): bool Foo::operator==(const Foo& other) { return bar == other.bar; } // Implementation 1 bool Foo::operator!=(const Foo& other) { return bar != other.bar

it is possible to overload somehow operator for multidimensional array? Something like: class A { ... int& operator[][] (const int x, const int y); ... } thanks in advance

In .h file ostream& operator <<(ostream &os,const object &); In .cpp file ostream& operator <<(ostream &os,const object &mono) { os << mono.coef<< *X^

How would one implement a ternary comparison operator to determine, for example, the boolean value of a < b < c?

We can overload assignment operator as a normal function, but we cannot overload assignment operator as a friend function. Why?

I found this question at http://www.phpinterviewquestions.com/php-interview-questions/operator-precedence/ Following operations are true or false? (Operator Precedence) $one = true; $two = null; $a =

I read that the ^ operator is the logical xor operator in c#, but i also thought it was the power of operator. Can someone clear this up for me?