Message Boards Message Boards

GROUPS:

Different results of N in the first and second call.

Posted 2 months ago
305 Views
|
1 Reply
|
0 Total Likes
|

Dear all,

When I use N[] to calculate some digits, I got different results during the first evaluation and the second evaluation. In particular, the result of N[Log[2], 38] is wrong compared to the second call: The last digit changes.

Please run this code in a new started kernel:

"First call"
N[Log[2], 37]
N[Log[2], 38]
N[Log[2], 39]
N[Log[2], 40]
"Second call"
N[Log[2], 37]
N[Log[2], 38]
N[Log[2], 39]
N[Log[2], 40]

Output:

"First call"
0.6931471805599453094172321214581765681
0.69314718055994530941723212145817656807  (* Last digit "7" is wrong *)
0.693147180559945309417232121458176568076
0.6931471805599453094172321214581765680755
"Second call"
0.6931471805599453094172321214581765681
0.69314718055994530941723212145817656808  (* Last digit "8" is now right *)
0.693147180559945309417232121458176568076
0.6931471805599453094172321214581765680755

I use Mathematica 10.0.2 (x64) on Windows 10

Posted 2 months ago

Unable to reproduce on 12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020). Must have been fixed since V10.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract