# How to express number in exponential decimal such as 1e2=100?

I am using MATLAB for a long time, and usually I express the number as exponential decimal such as

x = 1e2; % x=100


However, if I write this form in mathematica, it regards the e between 1 and 2 as a symbol (variable).

Do you guys know any expression using alphabet e for that, or should I change the form into using 10 such as

x=10^2;

• I do not know of an equivalent to 1e2 except, perhaps, 1*^2. Commented Sep 19, 2021 at 14:51
• Use: *^ In the documentation it's mentioned briefly in passing in ref/NumberMarks - also mentioned in tutorial/Numbers Commented Sep 19, 2021 at 14:53
• @bbgodfrey, the expression 1e2 is general form in MATLAB. For example, 3e2 indicates 3 x 10^2. Similarly, 3.2e1 is 3.2 x 10^1 = 32.
– Juno
Commented Sep 27, 2021 at 14:05
– Juno
Commented Sep 27, 2021 at 14:06

I'd say the best thing to do is to get used to the convention of Mathematica i.e. using 10^2 or 1*^2. Anyway, if you insist, one possibility is to make use of free form input by pressing Ctrl+=:

But to use free form input it's necessary to connect to the Internet and the interpretation may not always be correct, so a more robust solution is to define our own function:

SetAttributes[eScientificNumber, HoldAll];
With[{toreal =
If[\$VersionNumber >= 12.3, InternalStringToMReal, InternalStringToDouble]},
eScientificNumber[n_] := toreal@ToString@Unevaluated@n];

eScientificNumber /: MakeBoxes[eScientificNumber[n_], StandardForm] :=
TemplateBox[{MakeBoxes@n}, "eScientificNumber", DisplayFunction -> (FrameBox@# &)]


The MakeBoxes[…] rule isn't necessary, it's just for the sake of aesthetic. The function name eScientificNumber is a bit too long to input repeatedly, so let's make use of input aliase and palette:

CurrentValue[$$FrontEnd, "InputAliases"] = Append[DeleteCases[CurrentValue[$$FrontEnd, "InputAliases"], "esn" -> _],
"esn" -> MakeBoxes@eScientificNumber[\[SelectionPlaceholder]]];

CreatePalette[PasteButton@Defer@eScientificNumber[\[SelectionPlaceholder]],
WindowMargins -> Automatic]


You can even add your own keyboard shortcut as shown in e.g. this post but I'd like to stop here.

Now you can input 100 with 1e2 in following manners: