cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Leading Zero Frustration

Old-MCAD-User
10-Marble

Leading Zero Frustration

OldMCADUser_0-1734126242895.png

MathCAD Prime 7.0 is where my company is still stuck at, but it still has the very frustrating limitation/bug of not accepting decimal numbers without putting a leading zero before the decimal. It allows you to do this when calculating a number, but not when using units. Has this been fixed in subsequent versions? 

 

It is frustrating not only from the standpoint that I never put leading zeros before a decimal, and never have, never do on any other program/software, and it's not a problem at any other time on any other software package I use (including MathCAD Prime 7.0) UNTIL I try to use units in the calculation. I have hundreds of worksheets where I have not used leading zeros and it used to calculate everything just fine, even with the use of units.

9 REPLIES 9
LucMeekes
23-Emerald III
(To:Old-MCAD-User)

Maybe type an * (explicit multiplication) between the 2 and the i...

 

Success!

Luc

I can confirm that this behaviour has not changed in Prime 10.

 

As a workaround you may type an explicit multiplication (*) between the number and the unit as suggested by Luc or (for consistency) an implicit one which you get by pressing ctrl-shift-U.

Werner_E_0-1734146843735.png

BTW, Prime calls this implicit multiplication the "scaling operator".

 

StuartBruff
23-Emerald III
(To:Werner_E)


@Werner_E wrote:

BTW, Prime calls this implicit multiplication the "scaling operator".


 

I've occasionally wondered why PTC called it the "scaling operator" or, to be more precise, why they gave it the functionality they did.   

 

AFAICT, the "S-expression" associated with each maths region doesn't so much affect the nature of the calculation but rather the chosen display form.   Certainly, the scaling operator scales scalars, but its prime(!) purpose seems to be to tell Mathcad not to draw a multiplication operator between terms that Mathcad is actually multiplying.

 

2024 12 14 A.png

 

The Hadamard (element-by-element or vectorized) product would, IMO, have been a more mnemonic operation on arrays.

 

Stuart

The reason you can't type ".2in" is because the dot is a valid leading character in an identifier name.

 

2024 12 14 E.png

 

When the number begins with 0, Mathcad Prime recognises a non-numerical character as the number string terminator (unless that character is an i or a j, in which case Mathcad interprets the number as imaginary). 

 

Stuart

 

From the Mathcad Prime 10 Help:

 

Variable and Function Names
 
Variable names, function names, unit names, constant names, etc, are generically referred to as identifiers.
 
Identifiers can contain any valid Unicode character from the Base Multilingual Plane (BMP) with the exception of white space and control characters, and with the additional limitation that the first character cannot be a decimal digit (0-9). Unicode BMP characters are defined as having a code in the range 0-65535.
 
The label associated with an identifier is considered part of its name when distinguishing it from another identifier. This makes it possible to define a new function mean with the Variable label, and still be able to refer to the built-in function mean by specifying the Function label. However, if you define a new function mean with the Function label, you will be hiding the built-in definition of that function.
Identifiers are case-sensitive, can be of any length, and may contain any combination of valid characters:
 
Letters—Uppercase and lowercase letters.
Digits—0 through 9, but not as the first character of a name. PTC Mathcad interprets leading digits in combination with letters as either an imaginary number (2i or 3j) or as a number times a variable (3x).
Dot—A single, punctuation character, period can be used any where; including as the first character.
StuartBruff
23-Emerald III
(To:StuartBruff)

A little more digging shows that the ISO 80000-1:2022 states:

 

If the magnitude (absolute value) of the numbers is less than 1, the decimal sign shall be preceded by a zero." 

Earlier versions, including the British Standard 31, have similar wording, although the “shall” is replaced by “should” in some cases.

 

So, Mathcad’s behaviour in this respect would appear to be formally neither a limitation nor a bug but rather correct, irrespective of common practice.


Stuart

Werner_E
25-Diamond I
(To:StuartBruff)


So, Mathcad’s behaviour in this respect would appear to be formally neither a limitation nor a bug but rather correct, irrespective of common practice.

I fully agree.

Accepting numbers starting with a decimal point is just a courtesy, as this habit seems to be common in some parts of the world, but it is certainly not a requirement.
The fact that you now have to insert the scaling operator manually in such cases is, in my opinion, a small price to pay for this concession.
I do not think it would be justified to restrict the possibility of using variable names with a leading dot followed by digits and others.

 

Where I live, we use the comma and not the period as a decimal separator, and omitting the zero before the comma is not usual (at least not nowadays). With a calculation like 50*,2, and especially with 50*.2, many people would probably get the result 100 because they would think the small decimal separator was either a typo or the legacy of a fly on the paper (or the monitor). With handwritten calculations, some would perhaps even get 600 because they would think the comma was a failed digit one.
So for me it is perfectly understandable and also reasonable that the standards support the writing of the leading zero in these cases with some emphasis.

But of course I understand that when you are used to use a certain short, you have the wish that the software you use should support it as well. 

Yes, my problem is with the past ~30 years of using MathCAD, Excel, Origin, SolidWorks, AutoCAD, etc. is that none of these  software applications widely used for Engineering calculations require a leading zero before a decimal point for numbers less than 1, some software changes the number upon entering it (hitting the enter key) to add a leading zero automatically, likely in line with the mentioned ISO standard. But through MathCAD v15 I was still not using leading zeros with all of my units calculations (nearly 100% of my worksheets) and it had no problem doing so. 

 

In fact, my old worksheets from v15 and earlier MathCAD versions show an explicit "multiplication sign" between the .XXX number less than zero and the units typed. Below was the old version of MathCAD accepting a typed ".118" immediately followed by "in" and hitting the Enter key. MathCAD in these older versions of v15 and prior wasn't even changing the number to add the leading zero, back then.

OldMCADUser_0-1734373199212.png

All of my MathCAD v15 and earlier versions of MathCAD accepted the lack of a leading zero but still accepted the typed units (in) directly entered after the number with no other digit gymnastics or additional operators required. MathCAD used to accept this method of numerical input along with the immediate units system for ~30+ years which creates a frustrating exception for only MathCAD Prime, and only when I am using units in the equations.

I would only see it as a very minor annoyance, but if it bothers you so much that you sometimes have to explicitly insert a multiplication sign or a scaling operator, you can submit a product idea to PTC.

 

Mathcad 15 accepts the input .118in and interprets it correctly. Normally you would not see a dot

Werner_E_0-1734375045686.png

but in MC15 thats configurable (right click menu).

However, MC15 does not allow variable names that begin with a dot, as the dot is the subscript character, which was unfortunately changed to “ctrl -” in Prime in an unnecessarily complicated way. Prime also allows variable names to return from the subscript to the normal state

Werner_E_1-1734375147393.png

which is not possible with MC15.
You can never have everything 😞

 

StuartBruff
23-Emerald III
(To:Werner_E)


@Werner_E wrote:

You can never have everything 😞


 

As the old poem goes:

 

This damn computer is no good,

I wish that they would sell it.

Instead of doing what I want,

It does just what I tell it.

 

There should probably be a second verse that warns of the perils of significant changes between versions and the Curse of the Fine Print in release documentation.

 

Still, I feel that with the advent ('tis the season for it, after all) of semi-workable AI that this should no longer be the case.   I demand that Mathcad Prime 11, 12 at the latest, OK, 13 and that's my final offer, has an advanced AI that analyzes a worksheet and modifies it according to the end-user's needs rather than than the author's input (or random scribblings, in my case (which is another long-requested feature - the ability to use a pen to jot equations down and have them translated into Mathcadese ... preferably via LATEC)).

 

Stuart

Announcements

Top Tags