PDA

View Full Version : Precision in c


jaspreet2142
May 12, 2008, 07:09 PM
I have a precision problem in c
this can be understand better by an example
I declare a variable in float
then I stored in it 0.10101
but when I printed it it shows 0.10095
how can I remove this problem because I can't lose any digit, precision is very imp for my program

Jhon m
Jun 9, 2008, 08:54 PM
Use double instead of float. To extend a precision use long double.