Extract decimal part from a floating point number in C -


How can we remove the decimal part of a floating point number and the decimal part and integer part can be divided into two different integer variables You can use the modf function:

 

repeat Integral Double partial = modf (some_ double, and integral);

You can put it in an integer, but it can be warned that you can overflow the integer then the result can not be estimated.


Comments