[Issue 2973] std.math.pow(int, int), etc.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 21 20:15:21 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2973





--- Comment #4 from Andrei Alexandrescu <andrei at metalanguage.com>  2009-07-21 20:15:20 PDT ---
(In reply to comment #3)
> Couldn't you just stick an assert in there to make sure it doesn't wrap around?
>  I haven't tested, but I would think that even in debug mode, this would be
> faster than using the float version.

1. Please test. What powers are you looking at? For most bases and most
exponents the result will go off range.

2. I prefer returning a floating point number instead of attempting to return
an integer and failing dynamically, all for a doubtful speed benefit.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list