Qalculate / libqalculate

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

some problem with degree arcminute arcsecond #692

Open howaboutuser opened 1 month ago

howaboutuser commented 1 month ago

1

> 1°2'3"

  warning: Misplaced operator(s) "+" ignored
  (1 degree) + (2 arcminutes × 3 arcseconds) ≈ 8.461594994 nsr + 1°

expect 1.034166667°

2

> 1deg2'3"

  1 degree × ((2 feet) + (3 inches)) = 27 in·°

> 1deg2arcmin3arcsec

  1 degree²·arcminute³·arcsecond ≈ 0.03635029616 μsr³

Not sure whether this is a bug, it seems depend on how it parse.

3

> nounit(1deg+2arcmin+3arcsec) to time   

  nounit((1 degree) + (2 arcminutes) + (3 arcseconds)) = 6:00

> help nounit

Function: Strip Units

nounit(Expression)
stripUnits

Removes all units from an expression. The expression is calculated before the removal.

Arguments
Expression: a free value

expect 1:02:03

hanna-kn commented 1 month ago

1 has now been fixed. 2 is as expected (and indirectly as intended, even though a bit confusing). 3 is as intended (no unit conversion occurs before units are removed), but the function description is unclear (now updated).

howaboutuser commented 1 month ago

No unit conversion or prefix changes are performed before the removal.

How about "Unit is remove before evaluate the expression"? Or maybe a simple example nounit((1 kilometer) + (1 meter)) = 2 (absolutely clear)