exponential errors

NonNull non-null at use.startmail.com
Mon May 8 04:13:11 UTC 2023


On Monday, 8 May 2023 at 03:22:02 UTC, anonymouse wrote:
> Never thought I'd have to do this but, in Python:
>
> ```Python
> pow(1/2, 3)
> ```
> output:
> ```
>  0.125
> ```
> in D:
>
> ```D
> import std.stdio;
> void main()
> {
>   writeln((1/2)^^3);
> }

Using DMD64 D Compiler v2.103.0:

The above program ran and output ```0``` because ```1/2``` is 
zero in D as that's integer division. Putting 1.0 instead of 1, 
it output ```0.125```.

Your compiler version is?






More information about the Digitalmars-d-announce mailing list