For Fixed numbers, truncates the fractional portion by rounding to nearest, down, or up (respectively). Currently the only options to do this involve mucking about with bit shifting/masking and checks. A built-in would be less messy.
Note: I'm a bit torn on the name "Int()" since it still returns fixed-point, which is potential confusion. Is there a better name for this?
[ACS] Int(), Floor(), Ceil()
Moderator: GZDoom Developers
- NeuralStunner
-
- Posts: 12326
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [ACS] Int(), Floor(), Ceil()
What you want is clearly 'round()'.
- NeuralStunner
-
- Posts: 12326
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: [ACS] Int(), Floor(), Ceil()
That could work. (Or are you suggesting having a single function for all three operations? If pcode bloat is a concern, I'm all for that.)