Spec on casting to integer with smaller range than value

Johan j at j.nl
Sat Mar 28 12:09:49 UTC 2020


Hi all,
   Where can I read in the spec what the outcomes of the following 
are?

```
uint a = 260;
auto b = cast(ubyte) a;

float f = 1.203125f  * 255.0f;
auto zz =  cast(ubyte) f;
// https://github.com/ldc-developers/ldc/issues/3237
```

Thanks,
   Johan



More information about the Digitalmars-d mailing list