[G4] 2+2=4.0000001?

Paul Moortgat paul.moortgat at pandora.be
Fri Feb 27 08:15:27 PST 2004


Pcalc has no roundoff error.  Take 29 degrees, ask sin, cos, tan, 
tan-1, cos-1 and sin-1 and you get 29 degrees back.  Do this will all 
the calculators you know, even the HP hardware calculators.  You get 
something else as result.

Paul Moortgat

On 27-feb-04, at 04:18, CJ Scaminaci wrote:

> 	This is a roundoff error from the FPU. In a calculator (in 10.2 and 
> 10.3 at least), they use the floating point unit for all calculations. 
> Floating point calculations aren't known (at least from a programming 
> point of view) for being accurate in all cases ;).
>
> 	In this instance, they used a floating point calculation when a 
> simple integer operation would have worked. The FPU rounds numbers, 
> even whole numbers sometimes, unnecessarily. This causes errors, as 
> seen in this instance.
>
> 	Also, this is very hard to reproduce, because of how the FPU works. 
> Normally it would know better than to round a whole number. Here, that 
> wasn't the case. Just a simple mistake on the part of the FPU.
>
> --CJ
>
>
> ----------
> G4ist, a listserv for discussion of everything G4.
> FAQ at <http://www.themacintoshguy.com/lists/G4.html>.
> Send a message to <G4-DIGEST at themacintoshguy.com> to switch to the 
> digest.
>
> XRouter | Share your DSL or cable modem between multiple computers! 
> Dr. Bott | Now $139.99      <http://www.drbott.com/prod/xrouter.html>
>
> Dr. Bott LLC   4-port USB Hub in translucent Graphite!
> Dr. Bott LLC   <http://www.drbott.com/prod/ghub.html>
>
> Small Dog Electronics   http://www.smalldog.com  | Canon Digital 
> Cameras |
> --Quicksilver & refurbished G4's arriving daily! |   and Camcorders!!  
>   |
>
> MacResQ Specials: LaCie SCSI CDR From $99! PowerBook 3400/200 Only 
> $879! Norton AntiVirus 6 Only $19! We Stock PARTS! 
> <http://www.macresq.com>
>
> OS X News, Dr.Mac, Forums, Tutorials, Tips, Hints, FAQ?s - 
> http://www.osxfaq.com
>
>
>



More information about the G4 mailing list