HP Forums

Full Version: (Free42) matrix copy/paste bug
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Strange, because that's what I did.. in Firefox.
Anyway - found another anomaly ;-)
If I try and create a Nx2 matrix with a "J" in the (1,1) position, I get a complex matrix? So I change the "J" into something else and then it works.
Can't guarantee the tabs will show up here:

Code:
J    1
erg    1ᴇ-7
Kcal    4186.8
cal    4.1868
Btu    1055.05585262
ft×lbf    1.35581794833
therm    105506ᴇ3
MeV    160219ᴇ-18
eV    160219ᴇ-24

Cheers, Werner
"J" / "j" is accepted as an alternative spelling of "I" / "i", so your Joule unit turns into (0, 1).

Hmmm, maybe I should make it accept only lowercase i and j as the imaginary unit. Does anyone actually use uppercase I or J for this? I don't remember why I coded it that way...
Yes, that’s what I figured - but the 42 does not know i or I or j, it’s always a string?
Werner
I don't understand the question. Are you saying there is an inconsistency? If so, where?
I was wrong - it does know i of course, but not a lone i, and not a j or J.
It’s not a big deal, you know..
Werner
(02-09-2018 05:49 PM)Werner Wrote: [ -> ]I was wrong - it does know i of course, but not a lone i, and not a j or J.
It’s not a big deal, you know..
Werner

Do you mean how it displays and copies numbers, vs. the formats it accepts when pasting?
I'm having trouble making sense of your first sentence.
You cannot enter i in the 42. It displays it in complex numbers, that is all.
i is shown as ‘0 i1’ - that’s what I mean with it not being a lone i.
I have no idea what formats the copy/paste accepts for complex numbers? Apparently it interprets J,j,I,i as 0 i1.
One way to solve this is to allow defining strings between double quotes. Then I can put “J” for a string and J for a complex number.
Cheers, Werner
Paste recognizes complex numbers is these formats:

NUMBER ANGLE_SYMBOL NUMBER
NUMBER SIGN UNSIGNED_NUMBER IMAGINARY_UNIT
NUMBER SIGN IMAGINARY_UNIT
( NUMBER , NUMBER )

Where ANGLE_SYMBOL is ∠ or ∡ (U+2220 "angle" or U+2221 "measured angle")
SIGN is + or -
IMAGINARY_UNIT is I, i, J, or j
Also, in the vector notation, : or ; may be used instead of comma. If comma is used, it must be separated from the numbers preceding and following it by spaces.
Thanks, Thomas.
Why
NUMBER SIGN UNSIGNED_NUMBER IMAGINARY_UNIT
And not
NUMBER NUMBER IMAGINARY_UNIT


moreover, it seems IMAGINARY_UNIT must always be preceded by a number, so why does a lone J get interpreted as a complex number?

Cheers, Werner
(02-10-2018 06:15 AM)Werner Wrote: [ -> ]Why
NUMBER SIGN UNSIGNED_NUMBER IMAGINARY_UNIT
And not
NUMBER NUMBER IMAGINARY_UNIT

Because the latter would allow, say, "2 3i". I think there should always be a + or a - between the real and imaginary parts in this kind of notation.

(02-10-2018 06:15 AM)Werner Wrote: [ -> ]moreover, it seems IMAGINARY_UNIT must always be preceded by a number, so why does a lone J get interpreted as a complex number?

I goofed and missed that case in my list of accepted formats. The code does, in fact, handle this.
The imaginary unit does not have to be preceded by a number; 1+i and 1-i are valid, and so are i and -i.
Thanks for the detailed explanation!
Werner
In 2.0.14, I and J are no longer recognized as the imaginary unit; only i and j are.
Regarding the use of quote signs to force a cell to be interpreted as a string: I hope the 2.0.14 change makes that issue mostly moot. Smile
Well, yes and no ;-) The day I need to copy a string "i" or "j", I'll be back ;-)
Thanks, Thomas !

Werner
Pages: 1 2
Reference URL's