Open
Description
Consider the three operators:
- multiplication
*
- division
/
- function application/implicit multiplication/implicit addition (used in
sin pi
,3 kg
,(2)(4)
or1 1/2
).
Current these are all parsed mostly left-to-right, with mostly the same precedence (and a bunch of special cases).
These calculations are correct and should continue working as they do now:
1 3/8 inches
1/2 kg
3pi/2 radians to degrees
-sin (pi/2)
5 feet 2 inches
These examples don't do what the user might expect:
1 meter / 5 seconds
(parsed as(1 meter / 5) * seconds
)sin pi/2
(parsed as(sin pi)/2
)
This calculation can't be parsed at all:
3sin 5
(should be equivalent to3 * (sin 5)
)
It would be nice to come up with a consistent solution for all these expressions, preferably not involving whitespace.