Integer Exponent multiplier (for enums/ints)

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Integer Exponent multiplier (for enums/ints)

Post by Major Cooke »

According to Gutawer who did some testing, performing x * x (up until 9 multipliers, then it gets slower) is apparently faster than doing x ** y. In particular this seems a bit counter-intuitive especially if we're just doing integer multiplication.

And on that note:

Code: Select all

enum TestNum
{
	MyVar = 8 ** 2
};
Currently this does not work. I suggest an integer version of exponential power.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Integer Exponent multiplier (for enums/ints)

Post by Graf Zahl »

Yeah, that shouldn't be too hard to add.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Integer Exponent multiplier (for enums/ints)

Post by Major Cooke »

Awesome. That way this doesn't have to be a royal pain to deal with.
Post Reply

Return to “Feature Suggestions [GZDoom]”