I have a float like 23.248500. Is it possible for me to simply get the part 23and part 0.248500separately?
23.248500
23
0.248500
thank
For positive numbers, you can use floor(f)to get 23and f - floor(f)to get a part 0.248500.
floor(f)
f - floor(f)
(I linked the link to C ++, but the same function is present in the C library).
The right function for this modf().
modf()
What about:
float f = 23.248500; int a = (int)f; float f_minus_a = f - a;