Post Reply 
another BUG [ .^ ]
02-11-2014, 02:56 AM (This post was last modified: 02-11-2014 03:03 AM by churichuro.)
Post: #1
another BUG [ .^ ]
Hello every world!, my first post
don´t talk English, so be kind.

the Problem:

in home
in HP PRIME do:

any matrix or vector like [ 2 6 4 ]
then try to do .^3

and I get this :
[ 6 18 12 ] <--- wrong!!!

I must have this answer: [ 8 216 64]

the .^ work like .* then is an error

please report this error, because is really ugly !

P.D. in CAS this work right. or in home with this form CAS([2 6 4].^3)
Find all posts by this user
Quote this message in a reply
02-11-2014, 04:12 AM
Post: #2
RE: another BUG [ .^ ]
I can confirm this, happens in my prime too.

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
02-11-2014, 12:18 PM
Post: #3
RE: another BUG [ .^ ]
(02-11-2014 02:56 AM)churichuro Wrote:  Hello every world!, my first post
don´t talk English, so be kind.

the Problem:

in home
in HP PRIME do:

any matrix or vector like [ 2 6 4 ]
then try to do .^3

and I get this :
[ 6 18 12 ] <--- wrong!!!

I must have this answer: [ 8 216 64]

the .^ work like .* then is an error

please report this error, because is really ugly !

P.D. in CAS this work right. or in home with this form CAS([2 6 4].^3)

In CAS is OK but in HOME the result i wrong.
Find all posts by this user
Quote this message in a reply
02-11-2014, 01:05 PM
Post: #4
RE: another BUG [ .^ ]
Sorry, but I don't understand. The correct shouldn't be {2 4 6} ^ 3? In this case, the home results in { 8 216 64}.

Marcelo
Find all posts by this user
Quote this message in a reply
02-11-2014, 01:19 PM
Post: #5
RE: another BUG [ .^ ]
Sorry, I had missed the point in command "^ '. Indeed, this is new to me, and normally I would use lists for this type of operation.

Marcelo
Find all posts by this user
Quote this message in a reply
02-11-2014, 09:09 PM
Post: #6
RE: another BUG [ .^ ]
This might be an alternative/workaround for the time being (Home view, but also in CAS):

[2 4 6].^[3 3 3] returns [8 64 216].

Element-by-element operation, kind of like HADAMARD on the HP 50G.
Find all posts by this user
Quote this message in a reply
02-11-2014, 10:59 PM
Post: #7
RE: another BUG [ .^ ]
(02-11-2014 09:09 PM)Helge Gabert Wrote:  This might be an alternative/workaround for the time being (Home view, but also in CAS):

[2 4 6].^[3 3 3] returns [8 64 216].

Element-by-element operation, kind of like HADAMARD on the HP 50G.

very interesting Helge, but this work only if you know the number of elements in the vector
Find all posts by this user
Quote this message in a reply
02-12-2014, 12:27 AM
Post: #8
RE: another BUG [ .^ ]
Yes, but that is easy: just use SIZE() and then you know the length of the second vector to be filled with the constant.

Actually, I believe that element-by-element operations are the idea behind the ./ .+ .- .* .^ operators - - so that is how it appears to be designed.

What you attempted to do is a shortcut - - and I agree, it is a shortcut that makes sense and should also work in Home - - and it works in CAS, as we know!

Of course, you can always change your vector to a list and do this in Home: {2,4,6}^3 returns the correct answer.
Find all posts by this user
Quote this message in a reply
02-12-2014, 05:47 PM
Post: #9
RE: another BUG [ .^ ]
I have a problem with this element by element operations. OK, for matrix multiplication and power it makes sense. For vectors you have dot and cross products, but what is the meaning [1,2,3,4,5]^3 or {1,2,3,4,5}^3? It only makes sense if each element is raised to the 3rd power. IMHO [1,2,3,4,5]^3 should be the standard unless you do that on matrix then you need [[]].^(number).
Find all posts by this user
Quote this message in a reply
Post Reply 




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