Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pi constant #4170

Closed
vicuna opened this issue Nov 25, 2006 · 4 comments
Closed

pi constant #4170

vicuna opened this issue Nov 25, 2006 · 4 comments

Comments

@vicuna
Copy link

vicuna commented Nov 25, 2006

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.

@vicuna
Copy link
Author

vicuna commented Jun 1, 2012

Comment author: @garrigue

My standard code for pi is acos(-1.)
Is this too long?

@vicuna
Copy link
Author

vicuna commented 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
Copy link
Author

vicuna commented 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
Copy link
Author

vicuna commented Dec 7, 2016

Comment author: @alainfrisch

Sounds like a useful addition. A PR would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants