Advertisement

Power Operator

Started by December 16, 2013 08:25 PM
13 comments, last by WitchLord 10 years, 10 months ago

I've done some more thinking about the overflow exceptions. The C-runtime implementations vary on whether or not they set errno to ERANGE. They do all seem to return HUGE_VAL though. Perhaps the integer implementation should not overflow, but instead return INT_MAX.

There are also inconsistent implementations of 0**0. Microsoft seems to return 1.

The most important part is to be consistent. Perhaps you're right not to raise an exception in this case and instead return INT_MAX, but then the float and double variants my behave consistently and return the largest possible value.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

I took a quick look at the patch. It looks like everything is OK. You even took the time to update the documentation. Nice!

I'll be doing a bit of testing before I check in the changes, but rest assured that this will be part of the 2.28.1 release. :)

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I would have felt bad if I only did the fun part smile.png

I've checked in these changes in revision 1807.

Thanks,

Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement