gnome-calculator not giving expected results: 2e-2 is not 0.02 ...

Bug #483730 reported by Gabriele N. Tornetta
84
This bug affects 12 people
Affects Status Importance Assigned to Milestone
gcalctool (Ubuntu)
Fix Released
Medium
Robert Ancell
Karmic
Fix Released
Undecided
Unassigned
Lucid
Fix Released
Medium
Robert Ancell

Bug Description

Binary package hint: gcalctool

expressions like 4e<number> seem to work correcty when <number> is a positive integer,
e.g. +4. Wrong results are presented when <number> is a negative integer, e.g. -2.

ProblemType: Bug
Architecture: i386
Date: Mon Nov 16 18:48:31 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/gcalctool
Package: gcalctool 5.28.1-0ubuntu1
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-15.50-generic
SourcePackage: gcalctool
Uname: Linux 2.6.31-15-generic i686
XsessionErrors:
 (gnome-settings-daemon:2465): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (polkit-gnome-authentication-agent-1:2579): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
 (nautilus:2556): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed
 (gnome-panel:2555): Gdk-WARNING **: /build/buildd/gtk+2.0-2.18.3/gdk/x11/gdkdrawable-x11.c:952 drawable is not a pixmap or window

Revision history for this message
Gabriele N. Tornetta (phoenix1987) wrote :
Revision history for this message
Scott Howard (showard314) wrote :

Thanks for the report and working to make ubuntu better! However, I believe this is invalid since 2e-2 is 0.02

2e-2 = 2*10^-2 = 2*.01 = .02

Changed in gcalctool (Ubuntu):
status: New → Invalid
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Confirmed, gcalctool is confused and is doing the following:
2e2 = 2*10^2 = 200
2e-2 = 2*e - 2 = 3.44 (e = eulers number)

Changed in gcalctool (Ubuntu):
status: Invalid → Triaged
importance: Undecided → Medium
Revision history for this message
Robert Ancell (robert-ancell) wrote :
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Proposing for stable release update

Impact of bug: Users unable to use scientific notation
Solution: Code change to detect negative exponents correctly
Risk: Low, continues to pass unittests (gcalctool -u)

TEST CASE:
1. Open gcalctool
2. Enter 2e-2 (shift-e to enter e)
Expected result:
0.02

Revision history for this message
Oliver Joos (oliver-joos) wrote :

I can confirm this bug and would like to link a related bug: https://bugs.launchpad.net/bugs/495551

Changed in gcalctool (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted gcalctool into karmic-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in gcalctool (Ubuntu Karmic):
status: New → Fix Committed
tags: added: verification-needed
Mitch Towner (kermiac)
tags: added: verification-done
removed: verification-needed
tags: added: verification-needed
removed: verification-done
Revision history for this message
Mitch Towner (kermiac) wrote :

apt-cache policy gcalctool
gcalctool:
  Installed: 5.28.1-0ubuntu1
  Candidate: 5.28.1-0ubuntu1
  Version table:
 *** 5.28.1-0ubuntu1 0
        500 http://mirror.optus.net karmic/main Packages
        100 /var/lib/dpkg/status

Bug confirmed.
Performed test case as follows:
1. Open gcalctool
2. Enter 2e-2 (shift-e to enter e)
Result: 3.437

Updated from karmic-proposed
apt-cache policy gcalctool
gcalctool:
  Installed: 5.28.2-0ubuntu1
  Candidate: 5.28.2-0ubuntu1
  Version table:
 *** 5.28.2-0ubuntu1 0
        100 /var/lib/dpkg/status
     5.28.1-0ubuntu1 0
        500 http://mirror.optus.net karmic/main Packages

SRU verified as fixed.
Performed test case as follows:
Performed test case as follows:
1. Open gcalctool
2. Enter 2e-2 (shift-e to enter e)
Result: 0.02

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcalctool - 5.28.2-0ubuntu1

---------------
gcalctool (5.28.2-0ubuntu1) karmic-proposed; urgency=low

  * New upstream release:
    - Fix negative exponential detection e.g. "2e−3" = 0.002 (LP: #483730)
    - Only disable trailing zeroes option in basic mode (LP: #484306)
    - Disable ambiguous multiplication with Eulers number, e.g. "2e" as this
      makes exponential numbers confusing (LP: #495551)
 -- Robert Ancell <email address hidden> Fri, 18 Dec 2009 09:58:51 +1100

Changed in gcalctool (Ubuntu Karmic):
status: Fix Committed → Fix Released
Martin Pitt (pitti)
Changed in gcalctool (Ubuntu Lucid):
assignee: nobody → Robert Ancell (robert-ancell)
Revision history for this message
marco cammarata (marcocamma) wrote :

The problem is still there (gcalctool 5.29.4)

2e-2 = 3.43... instead of 0.02

Revision history for this message
Mitch Towner (kermiac) wrote :

Marco:
gcalctool 5.29.4 is in Lucid. The status for the Lucid package is "Fix Commited". This means that the fix has been commited to the gcalc bzr branch for Lucid (or the developers PPA/ personal bzr branch, etc, etc). This fix has not been released into the "main" repository for Lucid yet.

The status for Karmic (the distro that I tested the SRU for) is "Fix released" & it's working as expected in Karmic.

$ sudo apt-cache policy gcalctool
gcalctool:
  Installed: 5.28.2-0ubuntu1
  Candidate: 5.28.2-0ubuntu1

Please see https://help.launchpad.net/Bugs/Statuses for a more detailed explanation of bug status meanings.

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

the issue is fixed in lucid too now, closing the bug

Changed in gcalctool (Ubuntu Lucid):
status: Fix Committed → Fix Released
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.