Post Reply 
Vector or list to Number "conversion" (SOLVED.)
03-20-2015, 11:24 AM
Post: #5
RE: Vector or list to Number "conversion"
(03-20-2015 03:38 AM)Spybot Wrote:  [size=large]
Hi Guys!
I'm trying to compare the numeric value of two objects, one is a vector with only one numeric value and the other is a real number; [1/2]==0.5 the Hp Prime returns a zero.
...

(03-20-2015 09:46 AM)Angus Wrote:  If I define

result:=[1/2]

and do result(1)==0.5 it works on my emulator. You can access a list or vector by round brackets. First element index 1.

rigorously speaking, a vector with only one component is always a vector, non a real...
So, TYPE([½])= 4 (matrix or vector), and type([½]) = DOM_LIST, and in fact is also a list)

You must use [½](1) to get a value 0.5, and then
type([½](1)) = DOM_RAT and TYPE(...) = 0, a real

I hope this could help you.

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Vector or list to Number "conversion" - salvomic - 03-20-2015 11:24 AM



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