Message Boards Message Boards

1
|
2609 Views
|
1 Reply
|
3 Total Likes
View groups...
Share
Share this post:

Erf[2] returns Erf[2] but Erf[2.0] 0.995322

Posted 2 years ago

Hi,

After some lengthy troubleshooting I managed to narrow down the issue to the title. I am running Mathematica 13.1 on Zorin OS 16.2. Anyone else seeing this?

Thanks,
GW

This is how Mathematica fundamentally works, if you input an exact quantity it will return an exact quantity. Since Erf[2] can not be simply written, it will leave it as is; the simplest way is Erf[2]. If you input a machine-precision number 2.0, it will return a machine precision number. This is therefore expected behaviour.

Compare to e.g. Sin[30 Degree] which gives (exactly) 1/2, but Sin[30.0 Degree] gives 0.5. Hope this is clear. You can force numerical evaluation by doing N[Erf[2]].

POSTED BY: Sander Huisman
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