Tag Info

New answers tagged


test[x_] := With[{a = Length[First@RealDigits[x]], b = Round[Precision[x]]}, a == b ] the test is False for any Integer and Rational, exact symbols like Pi, etc. Its also False for N[m, n] for any m power of 10 and n been an Integer. As well as for some other Real numbers, I'm guessing depending on the internal representation. test[N[1, 10.3]] ...


You want Round[] for this: Round[1.234, 1.*^-2] - 1.23 0. This can be used with $PrePrint if needed.


To make your function work "throughout the workbook" you can use: $PrePrint = N @ Floor[#*100]/100 &; Now {1.23999, Pi} {1.23, 3.14} Restore $PrePrint to the default: $PrePrint =.

Top 50 recent answers are included