Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#80 Some expressions are not accepted in Formula Entry input mod

None
closed-fixed
nobody
gui (32)
5
2013-01-02
2012-05-04
Thure Dührsen
No

Dear Maintainer,
when using the calculator in Formula Entry mode, the following
expressions are printed in red instead of being evaluated:

0-0
0!
0^0 (should evaluate to the same value as 0.0^0.0)
5^0
0
-0
5+0
5-0
5*0
0+5
0-5
0*5
0/5
sin(0)
cos(0-5)
tan(0)
0m5
sqrt(0)
0<<5
0>>5
5<<0
5>>0
0%5
5%0
5&0
0&5
5|0
0|5
5x0
5x5
0&0
0|0

and possibly others.

By contrast, the following expressions work as expected:

-5 (is evaluated to -5)
sin(0.0) (is evaluated to 0)
5e0 (is evaluated to 5)
0e5 (is evaluated to 0)
0x5 (hexadecimal number 5, is evaluated to decimal 5)
5&5 (is evaluated to 5)
5|5 (is evaluated to 5)
5m0 (is printed in red as division by zero is not defined)
0x0 (hexadecimal number 0, is evaluated to decimal 0)

The choice of '0x' as a prefix for hexadecimal numbers appears to be a
bad one, as the string '0x' can also occur as part of a
bitwise-exclusive-or operation.

-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages galculator depends on:
ii libatk1.0-0 2.4.0-2
ii libc6 2.13-30
ii libcairo2 1.10.2-7
ii libglade2-0 1:2.6.4-1
ii libglib2.0-0 2.32.0-4
ii libgtk2.0-0 2.24.10-1
ii libpango1.0-0 1.29.4-3+b1
ii libxml2 2.7.8.dfsg-9

galculator recommends no packages.

galculator suggests no packages.

-- no debconf information

Discussion

  • Simon
    Simon
    2013-01-02

    Thanks for reporting, this issue was due to a bug in the parser w.r.t. to number zero that has been fixed with version 2.0.1.

    best, simon

     
  • Simon
    Simon
    2013-01-02

    • status: open --> closed-fixed
    • milestone: -->