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

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

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

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 1, 2012

Comment author: @garrigue

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

@vicuna

This comment has been minimized.

Copy link
Collaborator 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

This comment has been minimized.

Copy link
Collaborator 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

This comment has been minimized.

Copy link
Collaborator 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
You can’t perform that action at this time.