I am trying to figure out how to print floating point numbers without using library functions. Printing the decimal part of a floating point number turned out to be quite ea
I believe the problem lies in value /= base; Do not forget that 10 is not a finite fraction in binary system and thus this calculation is never correct. I also assume some error will occur in fmod due to the same reason.
printf will first compute the integral part and then convert it to decimal(if I get the way you printf the integral part correctly).