HP 10413 Datasheet Page 327

  • Download
  • Add to my manuals
  • Print
  • Page
    / 331
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 326
327
E.g. 6 Defining a user function
The DEF function allows you to define your own functions, which are then
available for use. In the example below it has been used to define Fermat’s
prime function
()
2
21
x
fx
=
+ . Note that the sequence of keys is:
ENTER ALPHA F ( XTθ
SHIFT = 2 X
y
2 X
y
XTθ
+ 1 ENTER
The CAS will then echo
the function back to you
and, if you go to the
VARS view, you will find
that it is now a defined
variable.
Although we used X as our variable here, there
is no reason for this. We could just as easily
have defined it as
()
2
21
K
fK=+.
You can now call this function by
simply typing, for example, F(5).
We can now test to see if
this is a prime number by
using the ISPRIME?
function from the MATH
menu. This is found in the Integer
section as shown right.
It returns a value of 0 (false) indicating that it is not
a prime number.
Using the FACTOR function
from the menu
shows that its factors are
641 and 6700417.
Page view 326
1 2 ... 322 323 324 325 326 327 328 329 330 331

Comments to this Manuals

No comments