2
$\begingroup$

Bug introduced in 10.0 and fixed in 10.4


A curiosity really, but why do I get garbage here?

TextString@NumberForm[3 10^23, 24]

300000000000000008388608.

And why does the output even have a decimal point?

Even more strange if we do this sequentially we get the expected result.

 NumberForm[3 10^23, 24]

300000000000000000000000

 TextString[%]

300000000000000000000000

This shows up in StringTemplate as well since TextString is the default InsertionFunction

V 10.1 / windows 7 64 bit and linux same issue.

$\endgroup$
5
  • $\begingroup$ I cannot reproduce your problem (either 10.4.1 for Mac OS X x86 (64-bit) (April 11, 2016) or 11.1.1 for Mac OS X x86 (64-bit) (April 18, 2017)). What version and OS are you using? $\endgroup$
    – Bob Hanlon
    Apr 27, 2017 at 15:31
  • $\begingroup$ v 10.1 / windows. $\endgroup$
    – george2079
    Apr 27, 2017 at 15:32
  • $\begingroup$ Is your Windows 32-bit or 64-bit? You will need someone with the same OS to verify. $\endgroup$
    – Bob Hanlon
    Apr 27, 2017 at 15:38
  • $\begingroup$ I cannot reproduce your question. $\endgroup$
    – yode
    Apr 27, 2017 at 15:39
  • 1
    $\begingroup$ Versions 10.4.0 through 11.1.0 give the correct result on 64-bit Linux; however, versions 10.2.0 and 10.3.1 show the same error. $\endgroup$ Apr 27, 2017 at 15:43

1 Answer 1

2
$\begingroup$

As mentioned in the comments, this bug has been fixed as of version 10.4.0.

TextString@NumberForm[3 10^23, 24]

(* "300000000000000000000000" *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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