bigint and pow

rassoc rassoc at posteo.de
Sun Oct 2 09:54:42 UTC 2022


On 10/2/22 09:24, Fausto via Digitalmars-d-learn wrote:
> Thanks a lot. I am to used to C and, more important, I didn't think to look for also another operator for the power function :)
> 

Oh, and I forgot to mention that this is doing what you probably asked for originally:

```d
import std;
import cmath = core.stdc.math;
void main()
{
     // both print 1e+72
     writeln(pow(10.0, 72));
     writeln(cmath.pow(10, 72));
}
```

But it's just floating-point scientific notation, not true BigInts.

Another math difference from C is that D has well-defined wrapping math for signed ints.


More information about the Digitalmars-d-learn mailing list