Post Reply 
CAS: Can't use "Minutes" with other Time Units
01-22-2014, 01:59 PM (This post was last modified: 01-22-2014 02:00 PM by Dominik Holenstein.)
Post: #1
CAS: Can't use "Minutes" with other Time Units
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


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
01-22-2014, 05:01 PM
Post: #2
RE: CAS: Can't use "Minutes" with other Time Units
The reason is that min is a reserved word, for minimum. You must use mn instead of min for units.
Find all posts by this user
Quote this message in a reply
01-22-2014, 05:46 PM (This post was last modified: 01-22-2014 05:46 PM by Dominik Holenstein.)
Post: #3
RE: CAS: Can't use "Minutes" with other Time Units
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
Find all posts by this user
Quote this message in a reply
01-24-2014, 06:43 PM (This post was last modified: 01-24-2014 07:22 PM by Snorre.)
Post: #4
RE: CAS: Can't use "Minutes" with other Time Units
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.
Find all posts by this user
Quote this message in a reply
01-24-2014, 07:04 PM
Post: #5
RE: CAS: Can't use "Minutes" with other Time Units
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.
Find all posts by this user
Quote this message in a reply
01-24-2014, 07:26 PM (This post was last modified: 01-24-2014 07:31 PM by Snorre.)
Post: #6
RE: CAS: Can't use "Minutes" with other Time Units
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?
Find all posts by this user
Quote this message in a reply
09-30-2015, 10:48 PM (This post was last modified: 09-30-2015 10:55 PM by StephenG1CMZ.)
Post: #7
RE: CAS: Can't use "Minutes" with other Time Units
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.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)