• Create Account

### #ActualApochPiQ

Posted 04 May 2012 - 08:36 PM

Significant decimal digits in base 10, or base 2?

For base 2, yes, you can tell how many significant digits are present trivially: there are 23 in single precision IEEE floats, and 52 in double-precision. You can use simple bit-counting algorithms to count how many of them are relevant in a particular value.

For base 10... well, not really. You have to convert the fraction to base 10 to know how many significant digits it represents (if it can even represent the base 10 value precisely!) at which point you've basically done a string format anyways.

### #1ApochPiQ

Posted 04 May 2012 - 08:35 PM

Significant decimal digits in base 10, or base 2?

For base 2, yes, you can tell how many significant digits are present trivially: there are 23 in single precision IEEE floats, and 52 in double-precision.

For base 10... well, not really. You have to convert the fraction to base 10 to know how many significant digits it represents (if it can even represent the base 10 value precisely!) at which point you've basically done a string format anyways.

PARTNERS