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
.