GNU bug report logs -
#41925
28.0.50; Error using calc-degrees-mode with calc-base-units
Previous Next
Full log
View this message in rfc822 format
It looks like Calc explicitly switches to radians mode during simplification with units:
(defun math-from-radians (a) ; [N N]
(cond ((and (not math-simplifying-units)
(eq calc-angle-mode 'deg))
(if (math-constp a)
(math-div a (math-pi-over-180))
(list 'calcFunc-deg a)))
((eq calc-angle-mode 'hms)
(math-to-hms a 'rad))
(t a)))
Presumably, this is done because the unit calculations somehow expect everything to be done in radians. I'm not sure how the machinery works, but to hazard a guess, suppose that
sin(30 deg)
would unit-simplify into
sin(30*(π/180))
then that would only give the right result if sin(x) only accepted radians no matter the current angle mode during this simplification process.
Obviously I didn't write Calc, and am not sure how to solve it without blowing something else apart. Perhaps you want to give it a go?
It also seems unclear how units and angle mode are supposed to interact. In degrees mode, arctan(1) evaluates to a dimensionless 45, not 45 deg.
This bug report was last modified 5 years and 52 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.