I am willing to cast precise operations and for that purpose I need a way to seperate a float number into an integer and a fractional part. Is there any way for this?
One other way using type cast.
#include #include void main() { float a = 3.4; float a_frac = a - (int) a; float a_int = a - a_frac; printf("Number = %f, Integer = %f, Fraction = %f", a, a_frac, a_int); }