I have a float like so 23.248500
. Is it possible for me to just get the 23
part and the 0.248500
part separately?
Thanks
For positive numbers, you can use floor(f)
function to get 23
, and f - floor(f)
to get the 0.248500
part.
(I linked C++ reference, but the same function is present in the C library).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With