Nim Nuggets: Nim talk at Strange Loop 2021

Imperatorn johan_forsberg_86 at hotmail.com
Sun Oct 17 14:47:15 UTC 2021


On Sunday, 17 October 2021 at 14:39:08 UTC, Ola Fosheim Grøstad 
wrote:
> On Sunday, 17 October 2021 at 11:14:15 UTC, Imperatorn wrote:
>> Well pow was just a random example, but as an example, what 
>> would the C++ version look like?
>
> Not sure what you mean, but in C++ floating point is considered 
> system specific. So the same executable could yield different 
> results on different machines for more complex constructs. 
> Since pow() could be provided by the OS/CPU there is no 
> portable optimization for it. Basically, the result is unknown 
> at compile time.

Maybe we're talking about different things.

What I mean is basically (stupid example, but just for the sake 
of discussion):
https://run.dlang.io/is/S3mZwq

How would you write it in C++ without modifying the stdlib


More information about the Digitalmars-d mailing list