iOS 4 calculator giving wrong answers

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
I don't recall the iPhone OS 3 calculator having this bug.

It seems that under some circumstances, the exponent of a floating point number overflows/underflows without triggering an error condition, or rounding to zero.

E.g. 1e-60 ^ 2 is evaluated as 1e+136.

Which is incorrect by a rather impressive 256 orders of magnitude.
 

aphex

Moderator<br>All Things Apple
Moderator
Jul 19, 2001
38,572
2
91
(the sound of an airplane flying over my head)

My iPhone calculation usually involves 1st grade math :)
 

AtlantaBob

Golden Member
Jun 16, 2004
1,034
0
0
Am I missing something? I can't even find a way to use exponents in the iOS 4 calculator? The absence of that ability makes it really complex to even do that calculation in the first place....
 

aphex

Moderator<br>All Things Apple
Moderator
Jul 19, 2001
38,572
2
91
Am I missing something? I can't even find a way to use exponents in the iOS 4 calculator? The absence of that ability makes it really complex to even do that calculation in the first place....

Turn your phone on its side
 

Leros

Lifer
Jul 11, 2004
21,867
7
81
I get the same thing.

Floating point is fun :)
 
Last edited:

TheStu

Moderator<br>Mobile Devices & Gadgets
Moderator
Sep 15, 2004
12,089
45
91
You should get the slide rule app!

Or, the HP calculator app that does reverse polish.
 

Kadarin

Lifer
Nov 23, 2001
44,296
16
81
I don't recall the iPhone OS 3 calculator having this bug.

It seems that under some circumstances, the exponent of a floating point number overflows/underflows without triggering an error condition, or rounding to zero.

E.g. 1e-60 ^ 2 is evaluated as 1e+136.

Which is incorrect by a rather impressive 256 orders of magnitude.

Clearly you're holding it wrong... :awe: