Should you be able to initialize a float with a char?

forkit forkit at gmail.com
Fri May 20 02:29:13 UTC 2022


On Friday, 20 May 2022 at 02:09:43 UTC, forkit wrote:
>

D suffers from the same problem as C.

// ---

module test;
@safe: // completly useless annotation here!

import std;

void main()
{
     int x = 3;
     int y = 4;
     float z =x/y;
     writeln(z); // 0

}

// -----


More information about the Digitalmars-d mailing list