3
$\begingroup$

It seems there is a bug in Mathematica 10.0.2 which is unable to display EngineeringForm properly:

In[95]:= EngineeringForm[1000000]
Out[95]//EngineeringForm= 1000000

If I stipulate the number to be real explicitly, it works though:

In[96]:= EngineeringForm[1000000.]
Out[96]//EngineeringForm= 1.*10^(6)

Can others confirm this bug?

$\endgroup$
  • 5
    $\begingroup$ Not a bug. From the docs: "prints with all real numbers … in engineering notation." Could have been clearer, tho, if they explicitly mentioned Real. So, not for exact numbers. $\endgroup$ – J. M. will be back soon Jul 19 '15 at 13:30
  • 5
    $\begingroup$ Use N to convert to floating point before using EngineeringForm. Exact numbers such as Pi, Sqrt[2], 7/5 or even 1*^10 won't be automatically converted to inexact forms by most *Form functions. $\endgroup$ – Szabolcs Jul 19 '15 at 14:16
5
$\begingroup$

The documentation could have been clearer about this, but at least it says

prints with all real numbers … in engineering notation.

Therefore, it is not a bug. Use N to convert to floating point before using EngineeringForm. Exact numbers such as Pi, Sqrt[2], 7/5 or even 1*^10 won't be automatically converted to inexact forms by most *Form functions.

Comment references: [1], [2]

$\endgroup$
  • $\begingroup$ Probably it can be understood from the documentation, however, the sentence fragment "prints with all real numbers in expr given in scientific notation." makes little sense. Because this can be understood that one has to supply real numbers in scientific notation to expr... No flame intended though, just that Mathematica documentation has rather poor English sometimes... $\endgroup$ – leosenko Jul 22 '15 at 4:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.