Nim Nuggets: Nim talk at Strange Loop 2021

Ola Fosheim Grøstad ola.fosheim.grostad at
Sun Oct 17 16:10:56 UTC 2021

On Sunday, 17 October 2021 at 14:47:15 UTC, Imperatorn wrote:
> How would you write it in C++ without modifying the stdlib

Well, you can't because pow() is not known at compile time (in a 
portable way). It is only known, in the general case, when 
executed. If you allow it to be evaluated at compile time you 
risk a compiletime pow(x,y) value to be different from a runtime 
pow(x,y) value even though the parameters are exactly the same. 
Which could lead to bugs (like comparing for equality).

More information about the Digitalmars-d mailing list