Qalculate / libqalculate

Qalculate! library and CLI
https://qalculate.github.io/
GNU General Public License v2.0
1.81k stars 146 forks source link

Input of negative exponent in RPN #707

Closed Messano47 closed 1 week ago

Messano47 commented 1 week ago

qalc v4.9.0 on kubuntu 24.10

Hello,

It seems that there is no way to input negative exponents of 10 using E in RPN.

> 2e5
  2 × 10⁵ = 200000

> 2e-5
  error: Character 'e' was ignored in the number "2e" with base 10.
  warning: RPN syntax error. Values left at the end of the RPN expression.
  −2 = −2

Also, entering negative number in one liner is awkward. Is there a way to avoid parenthesis, like a special negative value symbol?

> 2 5 ^
  2⁵ = 32

> 2 -5 ^
  (−2)⁵ = −32

> 2 (-5) ^
  2^−5 = 1/32 = 0,03125

Thank for the awesome CLI calculator anyway.

hanna-kn commented 1 week ago

Negative exponents in E notation has now been fixed.

Messano47 commented 1 week ago

Wow, that was fast! Thank you.