Int to float?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Mar 5 12:37:56 PST 2015


On Thursday, 5 March 2015 at 20:32:20 UTC, anonymous wrote:
> That's not really simpler, though.

Maybe, but I think the union is a bit nicer because then the 
compiler is responsible for more of the details. For example, it 
should work with class objects without the complication of 
dealing with the fact that they are already pointers under the 
hood.

Either way works though and should compile to the same 
instructions, just if I was doing it as a generic library, I 
think I'd use the union method.


More information about the Digitalmars-d-learn mailing list