Jump to content
Oliver Hope

[YLD-36096] Pi constant

Recommended Posts

Here is something that I should imagine being easy to add. Can we get the constant Pi under the maths section. Please and thanks☺️

  • Like 2

Share this post


Link to post
Share on other sites

If you *badly* want PI to a high degree of precision, it could be written as

\frac{\pi}{4}=1-\frac{1}{3}+\frac{1}{5}-\frac{1}{7}+\frac{1}{9}-\ldots

image.thumb.png.a188efd865a5401d9a876c7f6ac17f18.png

OR you can use PIfast (Im too lazy to write it myself)

image.png.5cd1dc0c9b0575a44e2a8b6ccbd54448.png

though, writing it in code would be hella difficult!

Imo, just copy paste the number and save yourself the headache... ?

Edited by Igor Q.
  • Like 4

Share this post


Link to post
Share on other sites

@Igor Q. thats pretty cool to know, but surely so much of that precision just gets lost if a number value is only 4 bytes? Not sure exactly how variables are handled in ylands (or any dynamic type checking language for that matter)... do they maybe dynamically change size up to 8 bytes ?

Yeah I just make a variable and copy in Pi, I just think it would be nice to have an inbuilt constant, its a pretty important number for maths?

  • Like 1

Share this post


Link to post
Share on other sites
On 10/3/2021 at 5:54 PM, Oliver Hope said:

Yeah I just make a variable and copy in Pi, I just think it would be nice to have an inbuilt constant, its a pretty important number for maths?

You can blame the devs for making the trigonometric functions not calculate in radians

200w.gif

  • Haha 1

Share this post


Link to post
Share on other sites

Hi, very nice (although not efficient ;) ) solution.

My would be just:

pi.PNG

All numbers in our scripts are "C# doubles" inside. Maybe this piece of information can be helpful for some of you.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×