9 years, 7 months ago.

floating point resolution/precision

Hi,

Any idea where I can find the epsilon values for double? I need to know the smallest fraction I can use in a double.

Also, is there a version of sin() that takes and rest urns long doubles?

Thanks.

1 Answer

9 years, 7 months ago.

Hi Johan.

Since the floats are IEEE 754 64 bit precision doubles, they have a machine epsilon of b ^-(p-1)/2. Where b is the base and p is the precision (53 for double with an implicit bit). This gives you 1.11e-16. So on average you can count on 16 significant digits.

Also, unless my memory fails me, all C 90 Math routines take and output doubles by default.

Regards,

Alfred

Accepted Answer