Page 1 of 1
ZScript π
Posted: Fri Jan 22, 2021 1:23 am
by Arctangent
there is something deeply distressing about the fact that zscript would flunk out of high school due to being unable to calculate the circumference of a circle
Re: ZScript π
Posted: Fri Jan 22, 2021 1:31 am
by wildweasel
You could, perhaps, define it as a constant whose value is the result of 22/7.
Re: ZScript π
Posted: Fri Jan 22, 2021 1:41 am
by Graf Zahl
const pi = 3.1415926535897932384626433832795;
Re: ZScript π
Posted: Fri Jan 22, 2021 6:30 am
by 3saster
I think in addition to properly exposing Pi natively in ZScript, it would be good to somehow expose/implement radian argument trigonometric functions as well.
Re: ZScript π
Posted: Mon Jan 25, 2021 11:02 pm
by kevansevans
Graf Zahl wrote:const pi = 3.1415926535897932384626433832795;
Wouldn't this open up potential conflict of multiple mods using their own definition of pi? I'd be really annoyed if my mods didn't work because I didn't use the same magic number as a different mod I was trying to replicate.
Most languages have this built into their standard math lib anyways, no harm adding it to ZScript.
Re: ZScript π
Posted: Sat Feb 13, 2021 12:52 pm
by m8f