[Issue 8562] math.pow fails at compile-time
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Aug 20 10:04:41 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8562
Jonathan M Davis <jmdavisProg at gmx.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jmdavisProg at gmx.com
--- Comment #4 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-08-20 10:04:39 PDT ---
> To avoid the casting in isNaN() you would need to know when it's getting called at compile-time and when it's getting called at run-time, correct? There is no way to know that, so we end up with two functions, isNaN() and staticIsNaN(), correct?
Wrong. __ctfe is true during CTFE and not during runtime. So, you can do
if(__ctfe)
{
//ctfe version
}
else
{
//normal version
}
http://dlang.org/function.html#interpretation
--
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