You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4170 Reporter: Richard Jones Assigned to:@garrigue Status: resolved (set by @alainfrisch on 2016-12-07T17:42:27Z) Resolution: suspended Priority: normal Severity: feature Version: 3.09.2 Category: standard library Related to:#5173 Monitored by: mehdi warwick @Chris00
Bug description
The stdlib should (IMHO) define a pi constant in Pervasives.
Is acos(-1.) the most accurate pi considering either the IEEE representation or the longer internal representation used by x86?
I know that glibc defines this constant carefully so that the most accurate pi is used. (glibc also provides long-double -- 128 bit -- variants but I guess we can't use those in OCaml).
Activity
vicuna commentedon Jun 1, 2012
Comment author: @garrigue
My standard code for pi is acos(-1.)
Is this too long?
vicuna commentedon Jun 1, 2012
Comment author: Richard Jones
Since you ask ...
Is acos(-1.) the most accurate pi considering either the IEEE representation or the longer internal representation used by x86?
I know that glibc defines this constant carefully so that the most accurate pi is used. (glibc also provides long-double -- 128 bit -- variants but I guess we can't use those in OCaml).
vicuna commentedon Oct 29, 2012
Comment author: warwick
I suggested a similar thing in issue 005173. I think having a predefined value "pi" is a lot clearer than having to write acos(-1.) ... or acos(-.1.)
vicuna commentedon Dec 7, 2016
Comment author: @alainfrisch
Sounds like a useful addition. A PR would be appreciated!