ZScript π
Moderator: GZDoom Developers
-
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
Re: ZScript π
You could, perhaps, define it as a constant whose value is the result of 22/7.
-
- Lead GZDoom+Raze Developer
- Posts: 49117
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript π
const pi = 3.1415926535897932384626433832795;
-
- Posts: 199
- Joined: Fri May 11, 2018 2:39 pm
- Location: Canada
Re: ZScript π
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.
-
- Spotlight Team
- Posts: 423
- Joined: Tue Oct 05, 2010 12:04 am
- Graphics Processor: nVidia with Vulkan support
Re: ZScript π
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.Graf Zahl wrote:const pi = 3.1415926535897932384626433832795;
Most languages have this built into their standard math lib anyways, no harm adding it to ZScript.
-
-
- Posts: 1446
- Joined: Fri Dec 29, 2017 4:15 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Manjaro Linux
- Location: Siberia (UTC+7)