5 ms·
I had a similar question a while ago: how many decimal digits does it take to represent the smallest possible 80 bit float. The answer is ~16000: #include <
by ldarby 10y ago
I had a similar question a while ago: how many decimal digits does it take to represent the smallest possible 80 bit float. The answer is ~16000:
#include <stdio.h>
int main(int argc, char **argv)
{
unsigned long long int mant, exp ;
mant = 0;
exp = 1;
typedef struct _bitfield80 {
unsigned int sign:1;
signed int exp:15;
unsigned long long int mant:64;
} bitfield80;
union {
long double a;
bitfield80 b;
} union80;
union80.b.sign = 0;
union80.b.mant = mant;
union80.b.exp = exp;
printf ("%0.17000Lf\n", union80.a);
return 0;
}
- jacobolus 10y agoDepends what you mean by “represent”. The smallest positive “denormal” 80-bit float is (I think) 2^(2 − 2^(14)). I just represented it using 5 decimal digits and two minus signs. :-)
- yiyus 10y agoThe Berry paradox takes this a bit further. It may appear that "the least integer not nameable in fewer than nineteen syllables" is 111777. But "the least integer not nameable in fewer than nineteen syllables" is itself a name consisting of only eighteen syllables, and therefore the least integer not nameable in fewer than nineteen syllables can be named using only eighteen syllables (!). There are alternative expressions, for example wikipedia mentions "the smallest positive integer not definable in fewer than twelve words" and "the smallest positive integer not definable in under sixty letters".