-
-
Notifications
You must be signed in to change notification settings - Fork 66
N[3^200] in formats as PrecisionReal instead of MachinePrecision #1740
Copy link
Copy link
Closed
Milestone
Description
Description
Numeric conversion N is converting to a PrecisionReal.
How to Reproduce and Output Given
Here is what we give:
In[1]:= N[3^200]
Out[1]= 2.65613988875875×10^95
In[16]:= N[Sqrt[19]]
Out[16]= 4.3588989435406735522369We should get:
In[1]:= N[3^200]
Out[1]= 2.65614×10^95
In[2]:= N[Sqrt[19]]
Out[2]= 4.3589Priority
Probably an easy fix. Should do before release.
https://github.com/Mathics3/mathics-core/blob/master/mathics/format/form/outputform.py#L752
digits = dps(n.get_precision()) if isinstance(n, PrecisionReal) else 6seems to be the offending line. The precision of the number is not the same thing as the display precision, whose default is 6. This is implicitly described in https://reference.wolfram.com/language/howto/ChangeTheFormatOfNumbers.html and https://reference.wolfram.com/language/ref/DefaultPrintPrecision.html
We might give thought on how to handle the DefaultPrintPrecision option.
Additional context
Noticed in going over discrepancies in a video on Mathematica, comparing output with what we have.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels