# Calculators on desktops (was Re: Octal)

der Mouse mouse at Rodents.Montreal.QC.CA
Fri Sep 1 22:45:47 CDT 2006

```> LAZY.
> It has non-integer math support for decimal, but they left it off of
> the other bases.

Lazy indeed.

>> I have never seen a hex number with a decimal point anyway...

Nor will you; as Fred already pointed out, it's a hexadecimal point.
That aside, they do exist, though they're rare.  While practically
everything these days uses IEEE floating-point, which is binary-based,
there have been machines with floating-point arithmetic that worked in
other bases, like octal or hex.  For them, speaking of the "decimal"
point in a number printed in hex notation makes perfect sense.

> As quick exercises, 1) what is the binary fraction for PI?

% calc
1> const(pi)
\$1 = 3.141592653589793238462643383279502884197169399375105820974944592
2> cvt(\$\$,2)
\$2 = #b11.00100100001111110110101010001000100001011010001100001000110101

Something seems broken in my computation of pi for high precision
values; when I try to use base 2 and 1023-"digit" precision, I get a
negative number(!).  But computing pi to 64-"digit" precision in base
255 (the highest that calculator program supports) and then converting
to binary gives

#b11.001001000011111101101010100010001000010110100011000010001101001100010011000110011000101000101110000000110111000001110011010001001010010000001001001110000010001000101001100111110011000111010000000010000010111011111010100110001110110001001110011011001000100101000101001010000010000111100110001110001101000000010011011101111011111001010100011001101100111100110100111010010000110001101100110000001010110000101001101101111100100101111100010100001101110100111111100001001101010110110101101101010100011100001000011011011011010110111101101011111101011101110100111001110000101111111001101000100000011001001011110100110011001010101011101101001001011101001000111011111011001110000100011110001100101001000000100000100100110100000010010101100100011010111010010101000001001110111111010010111001110000110101001111010001011110010001001000010100111001001011101100011110011100110001000110111010100100011010100000000010011100110001111100100111111000011010000100110010101111001010010000000110100001111111!
11!
11100101110111101101100001

of which I'd recommend not trusting the low dozen or so bits.

> 2) what is the IEEE 32 bit floating point bit pattern for PI?

01000000010010010000111111011011

0
Sign bit 0, indicating positive.
10000000
Excess-127 exponent 128 (unbiased exponent 1, value in [2,4)).
10010010000111111011011
Mantissa (1.)10010010000111111011011, rounded up from ...010 10100....

> 3) Who is attributed with "God created the integers, all else is the
> work of man"?

Leopold Kronecker, of Kronecker delta fame, I think it is.

I'm not entirely sure I agree with it, but then, I'm not sure to what
extent I'm a Platonist, so....

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
X  Against HTML	       mouse at rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

```