HP Forums
CAS: Can't use "Minutes" with other Time Units - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: CAS: Can't use "Minutes" with other Time Units (/thread-492.html)



CAS: Can't use "Minutes" with other Time Units - Dominik Holenstein - 01-22-2014 01:59 PM

Hello all,

When you are in CAS view then you can't perform calculations like:
Code:
40_(min) - 50_(s)

I get this error message:
"Incompatible units Error: Bad Argument Value"

The same calculation works in HOME view.

You can mix all time units except minutes.

All the best,
Dominik


RE: CAS: Can't use "Minutes" with other Time Units - parisse - 01-22-2014 05:01 PM

The reason is that min is a reserved word, for minimum. You must use mn instead of min for units.


RE: CAS: Can't use "Minutes" with other Time Units - Dominik Holenstein - 01-22-2014 05:46 PM

Many thanks for this hint!

But this should be fixed in CAS:

When you choose

Unit -> Time -> min

then you get this:

25_(min)

instead of

25_(mn)

All the best,
Dominik


RE: CAS: Can't use "Minutes" with other Time Units - Snorre - 01-24-2014 06:43 PM

Why doesn't the parser distinguish between "min" as a function and "min" as a unit?

There are no such problems with function Ci() and unit "Ci" (Curie), or with a Variable named "m" and unit Meters.


RE: CAS: Can't use "Minutes" with other Time Units - parisse - 01-24-2014 07:04 PM

Ci does the same as min. Try 1_Ci you'll get 1_'Ci', like for 1_min -> 1_'min'. Unlike for mn (or m), there is no quote. The way units work in the CAS does not allow command names as unit names, but there is no problem for variable names.


RE: CAS: Can't use "Minutes" with other Time Units - Snorre - 01-24-2014 07:26 PM

Can't the parser be rewritten so that "min" in unit context does something different than if used as a function?
I'm just asking because units are enclosed in parentheses (at least if composite) preceded by an underscore which is preceded by a number.
On the other hand, function "min" can't occur in this way or am I missing something out?
Is there a way to define a function "1_" so that 1_(min) would be a functional call?


RE: CAS: Can't use "Minutes" with other Time Units - StephenG1CMZ - 09-30-2015 10:48 PM

If this is still an issue, I would suggest "mins" is preferable to "mn".

Two reasons.

One, if you are searching for "min" in the help, you will also find "mins" (I hope), but you wouldn't find "mn".

Two, "mn" is not a recognised unit, but looks similar to "mm" (millimetres: 1 character misread), "nm" (nanometres: sequence inverted), "MN" (MegaNewtons: capitalised) or even "NM" (nautical miles), if read/typed in difficult viewing conditions, as portable equipment might well be (or if read by dyslexics). Whereas "mins" simply can't be anything else.