literate-calc-mode.el icon indicating copy to clipboard operation
literate-calc-mode.el copied to clipboard

Unit simplification in results

Open jwiegley opened this issue 1 year ago • 2 comments

Hello! Great mode, it could replace all my uses of the Soulver app on macOS.

One question I have: I made the alias for using uconv to do unit conversions, but it's not working as I would expect. For example, let's say I do the following in calc:

'120 gal
'794 ft^2
/                 => 1:  0.151133501259 gal / ft^2
u c in            => 1:  0.242443324937 in

This is great. But in literate-calc-mode I have:

flow = 120 gal
surface_area = 794 ft^2
loss_by_flow = flow / surface_area => loss_by_flow: 0.151133501259 gal / ft^2
result = uconv(loss_by_flow, in) => result: 1.04953820319e-3 gal / in^2

This is not the answer I would have expected, although it's correct in some sense. Why is it only applying the unit conversion to the denominator here, and not to the whole result?

jwiegley avatar Jul 31 '24 19:07 jwiegley