Opened 10 years ago

Closed 10 years ago

#5741 closed enhancement (fixed)

gnome-calculator-3.14.1

Reported by: Fernando de Oliveira Owned by: Fernando de Oliveira
Priority: normal Milestone: 7.7
Component: BOOK Version: SVN
Severity: normal Keywords:
Cc:

Description

http://ftp.gnome.org/pub/gnome/sources/gnome-calculator/3.14/gnome-calculator-3.14.1.tar.xz

http://ftp.gnome.org/pub/gnome/sources/gnome-calculator/3.14/gnome-calculator-3.14.1.news

    * Update : Translations (Translation team)
    * Update : Search provider timeout (Michael Catanzaro)
    * Workaround : Warning in search-provider log (Michael Catanzaro)
    * Fix : Crash on thousand saperator (Michael Catanzaro)
    * Fix : Button arrangement in programming mode (Abhinav)
    * Fix : Vala warning about empty conditional body (Michael Catanzaro)
    * Fix : Remove use of GtkAlignment (Michael Catanzaro)
    * Fix : Use set_accels_for_action() (Arnaud Bonatti)
    * Removed : Gtk.Widget.ensure_style() (Michael Catanzaro)
    * Removed : Use of fixes.vapi for langinfo (Michael Catanzaro)

Change History (3)

comment:1 by Fernando de Oliveira, 10 years ago

Owner: changed from blfs-book@… to Fernando de Oliveira
Status: newassigned

comment:2 by Fernando de Oliveira, 10 years ago

If test-number.vala is modified with the follwing diff:

--- ./src/test-number.vala.orig	2014-10-26 10:27:56.433976481 -0300
+++ ./src/test-number.vala	2014-10-26 11:50:15.218998087 -0300
@@ -79,7 +79,7 @@
         var z = new Number.float (a);
         if (z.to_float () != a)
         {
-            fail ("Number.float (%f).to_float () -> %f, expected %f".printf (a, z.to_float (), a));
+            fail ("Number.float (%3.12f).to_float () -> %3.12f, expected %3.12f".printf (a, z.to_float (), a));
             return;
         }
     }

actual printed values are :

FAIL: test-number
=================

*FAIL: Number.float (-9.500000000000).to_float () -> -9.499999987369, expected -9.500000000000
*FAIL: Number.double (-9.500000).to_double () -> -9.500000, expected -9.500000
Failed 2/51 tests

instead of

FAIL: test-number
=================

*FAIL: Number.float (-9.500000).to_double () -> -9.500000, expected -9.500000
*FAIL: Number.double (-9.500000).to_double () -> -9.500000, expected -9.500000
Failed 2/51 tests

The difference between the two numbers is ~ 1.3E-9. They should test the difference between the two numbers and consider to be equal if less than some value. For this test, 1E--6 or -7 would work. When I used to program I had a function zequal (x, y, acc) that would return that x=y is true or false, with the desired accuracy.that

comment:3 by Fernando de Oliveira, 10 years ago

Resolution: fixed
Status: assignedclosed

Fixed at r14741.

Note: See TracTickets for help on using tickets.