Int to float?

Benjamin Thaut via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Mar 5 12:03:10 PST 2015


Am 05.03.2015 um 21:00 schrieb Taylor Hillegeist:
> How to I cast a Int to float without changing its binary representation?

int someValue = 5;
float sameBinary = *(cast(float*)cast(void*)&someValue);


More information about the Digitalmars-d-learn mailing list