The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

HP PRIME: How to use [a b/c] key from a program
Message #1 Posted by Joseph Ec on 29 Oct 2013, 5:08 p.m.

Hi Friends,

I need to use integers or fractions (not reals) so i need to convert 0.3333.. to get 1/3 I can do with [a b/c] key but how to use that from inside a programs ?

Thans and best regards!!

jose

      
Re: HP PRIME: How to use [a b/c] key from a program
Message #2 Posted by Han on 29 Oct 2013, 5:12 p.m.,
in response to message #1 by Joseph Ec

Quote:
Hi Friends,

I need to use integers or fractions (not reals) so i need to convert 0.3333.. to get 1/3 I can do with [a b/c] key but how to use that from inside a programs ?

Thans and best regards!!

jose


Perhaps the EXACT() function is what you're looking for?

            
Re: HP PRIME: How to use [a b/c] key from a program
Message #3 Posted by CompSystems on 29 Oct 2013, 5:25 p.m.,
in response to message #2 by Han

[a <-> b/c ] dual function key => exact( ), approx()

example:

poly1[1,(-3*a-3*b-7)/3,(7*a+7*b+2)/3,(-2*a-2*b)/3];

[a <-> b/c ] =>

approx(poly1[1,(-3*a-3*b-7)/3,(7*a+7*b+2)/3,(-2*a-2*b)/3]); =>

poly1[1.,(-3.*a-3.*b-7.)*0.333333333333,(7.*a+7.*b+2.)*0.333333333333,(-2.*a-2.*b)*0.333333333333]

[a <-> b/c] =>

exact( Ans );

poly1[1,(-3*a-3*b-7)*1/3,(7*a+7*b+2)*1/3,(-2*a-2*b)*1/3]

Edited: 29 Oct 2013, 5:29 p.m.

                  
Re: HP PRIME: How to use [a b/c] key from a program
Message #4 Posted by Joseph Ec on 29 Oct 2013, 6:06 p.m.,
in response to message #3 by CompSystems

Friend,

Thank so much,

exact() command is the function tha I need,

But, [a b/c] works direct in all MATRIX elements and exact() doesn´t work with matrix ... I wil try to do element by element...

Best regards!! joseph

            
Re: HP PRIME: How to use [a b/c] key from a program
Message #5 Posted by Joseph Ec on 29 Oct 2013, 6:18 p.m.,
in response to message #2 by Han

Friend,

That was the trick BUT,

ONCE running in the emulator program i GET "The application has crashed and will be restarted"....

Would be nice if the calculator indicates the command that cause the failure and mainly the REASON (allowed types or hint ).

Some idea ?

Best regards!! joseph


[ Return to Index | Top of Index ]

Go back to the main exhibit hall