Scientific Notation not given proper order of operations

Bug #1210607 reported by scruss
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
GNOME Calculator
Expired
High
gnome-calculator (Ubuntu)
Opinion
Medium
Unassigned

Bug Description

gnome-calculator 3.8.1 (3.8.1-0ubuntu1) on Ubuntu 13.04 x86_64:

In Advanced mode, enter:

 8×10¹²÷6×10⁹

(keystrokes: [8] [×10^y] [1] [2] [/] [6] [×10^y] [9])

Result:

 1.333333333×10²¹

Correct answer:

 1333.33333333333

(so gnome-calculator is off by 18 orders of magnitude. The ‘×10^y’ steps should be carried out first, according to operator precedence for exponentiation.)

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: gnome-calculator 1:3.8.1-0ubuntu1
ProcVersionSignature: Ubuntu 3.8.0-28.41-generic 3.8.13.5
Uname: Linux 3.8.0-28-generic x86_64
ApportVersion: 2.9.2-0ubuntu8.3
Architecture: amd64
Date: Fri Aug 9 13:07:33 2013
ExecutablePath: /usr/bin/gnome-calculator
InstallationDate: Installed on 2013-04-13 (117 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
MarkForUpload: True
SourcePackage: gnome-calculator
UpgradeStatus: Upgraded to raring on 2013-04-26 (105 days ago)

Revision history for this message
scruss (scruss) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The issue you are reporting is an upstream one and it would be nice if somebody having it could send the bug to the developers of the software by following the instructions at https://wiki.ubuntu.com/Bugs/Upstream/GNOME. If you have done so, please tell us the number of the upstream bug (or the link), so we can add a bugwatch that will inform us about its status. Thanks in advance.

Changed in gnome-calculator (Ubuntu):
importance: Undecided → Low
Revision history for this message
scruss (scruss) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the upstream url

Changed in gnome-calculator (Ubuntu):
status: New → Triaged
tags: added: trusty
Changed in gnome-calculator:
importance: Unknown → High
status: Unknown → New
Changed in gnome-calculator:
status: New → Confirmed
Mathew Hodson (mhodson)
Changed in gnome-calculator (Ubuntu):
importance: Low → Medium
Revision history for this message
Christoph Michelbach (hj7-c) wrote :

Which calculator would do what you described? I just checked a few ones and didn't find any. I'd be surprised a lot, to be honest, because that'd be wrong and I probably would've gotten a very wrong result at some point because I rely on calculators having implemented the correct order of operations. Every school or university teaches that multiplication and division have the same precedence (modulo may or may not be on the same level, mostly depending on the notation) and are calculated from the left to the right. So 8*10^12/6*10^9 = 8*(10^12)/6*(10^9) = ((8*(10^12))/6)*(10^9)

Revision history for this message
siuyin (siuyin) wrote :

The problem is 1*10^2 is treated at two separate numbers or tokens.
In scientific notation 1e02 is treated at one token.

Thus 1e02/1e02 = 1

but 1*10^2/1*10^2 = 1*10^4

Hope this clarifies.

Changed in gnome-calculator:
status: Confirmed → Expired
Revision history for this message
Paul White (paulw2u) wrote :
tags: added: bionic
removed: raring
Changed in gnome-calculator (Ubuntu):
status: Triaged → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.