Movement against float.init being nan

Ali Çehreli acehreli at yahoo.com
Sat Aug 20 21:45:44 UTC 2022


On 8/20/22 14:07, Bastiaan Veelo wrote:

 > alias Distance = Typedef!(double, 0.0, "distance");

Great! :)

 > However, type information can get lost in intermediate results:
 > ```d
 >      t = 0.5 + d; // result is double
 > ```

Yeah, that's a bummer. Perhaps something like this could work: "have all 
the functionality of a double but don't implicitly convert to one." 
(Ironically, alias this is the implicit conversion tool.) And what do I 
mean? Only when being passed to a function? I don't know... :/

Ali



More information about the Digitalmars-d mailing list