### C++ question about non-integer parts of large doubles

Posted:

**Sat Sep 13, 2014 11:55 pm UTC**Okay, so I have this problem, where I need to multiply a float (which would always be between 0 and 1) by 4294967295 and get the non-integer part. Generally, this could be done with

but the number when multiplied by 4294967295 is too large for the information right of the decimal place to be preserved. Because I know one of the numbers being multiplied, I feel like there should be a way to do this without b exceeding a certain magnitude, but I can't figure out how. I'd rather not include any arbitrary precision libraries, if at all possible. Does anyone have a solution to this problem?

Code: Select all

`double a = whatever;`

double b = a*4294967295.;

answer = b - (int)b

but the number when multiplied by 4294967295 is too large for the information right of the decimal place to be preserved. Because I know one of the numbers being multiplied, I feel like there should be a way to do this without b exceeding a certain magnitude, but I can't figure out how. I'd rather not include any arbitrary precision libraries, if at all possible. Does anyone have a solution to this problem?