• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: magic integer converter number 62?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: magic integer converter number 62?


  • Subject: Re: magic integer converter number 62?
  • From: email@hidden
  • Date: Fri, 23 Feb 2001 23:53:05 -0500

On Fri, 23 Feb 2001 09:54:03 -0500, Deivy Petrescu <email@hidden> asked,

> The explanation did not convince me.
> First: it should work the same with 61 or 62 or show a pattern work
> not work every 2 powers of 2.
> Second: Paul originally argued that 62 +2 = 64 and that was what was
> going on. He was right. It does not explain, on the contrary shows
> another problem, namely, the expression:
> set b to ((x + (2.6 - (2.6 mod 1))) - x) as integer
> should, according to the rules of precedence, be computed inside
> out. That is, one should get 0.6 (or its periodic representation in
> binary) before adding or subtracting from x. Since, if one changes
> the number 2.6 to 3.6, 61 works fine and so does -67, this indicates
> that there are some sums going on before the due time.

I think the problem is that you aren't considering that this is floating point
format, with a fixed number of mantissa bits. Since you are subtracting 0.6
from 2.6, there is a misalignment.

In binary, to 24 significant bits, (with the "123456789012345678901234" label to
help keep the bit count right.)

12 3456789012345678901234
2.6 = 10.1001100110011001100110

123456789012345678901234
0.6 = 0.100110011001100110011010
(Note the rounding up. The last two significant bits are [01][10011...]
rounded to [10][00000...])

Line these up and subtract them, and you get

12 3456789012345678901234
10.1001100110011001100110
- 0.100110011001100110011010
---------------------------
1.111111111111111111111110

123456789012345678901234
which rounds to 24 bits as

1 23456789012345678901234
1.111111111111111111111110
---------------------------
1.11111111111111111111111

Or, 2 - 2^-23.

> My Graphing Claculator shows 2 to the power 1024 is infinity. Looking
> at the binary expansion for .10 or .60, I do not have a clue as to
> why 62 works and 61 doesn't. IEEE or not.

2^1024 is a bit more than 10^307. That's a
yotta-yotta-yotta-yotta-yotta-yotta-yotta-yotta-yotta-yotta-yotta-yotta-exa-bit.
Actually, using the exact binary prefixes, its a
yobba-yobba-yobba-yobba-yobba-yobba-yobba-yobba-yobba-yobba-yobba-yobba-ebi-bit.
Moore's Law tells us you'll be able to buy a disk this size in 994 18-month
time periods, or on 23 February, 3492. That's a Wednesday.

--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden


  • Prev by Date: Re: Ircle Script
  • Next by Date: Re: Digest default subjects
  • Previous by thread: Re: magic integer converter number 62?
  • Next by thread: Re: magic integer converter number 62?
  • Index(es):
    • Date
    • Thread