HP Pascal/iX Reference Manual (31502-90022)

9- 27
Example
Input Result
sqr(3) 9
sqr(1.198E3) 1.435204E+06.
sqr(-5) 25
sqr(maxint) { error }
sqrt
Usage
sqrt
(x)
Argument
x
Any positive numeric expression.
Description
The sqrt function computes the square root of its argument, which must be
an expression with a numeric type. It is an error if the argument is
less than 0. This function returns a real for sub-integer, integer, or
real arguments, and longreal for longreal or super-integer arguments.
Example
Input Result
sqrt(64) 8.000000E+00
sqrt(13.5E12) 3.674235E+06
sqrt(0) 0.000000E+00
sqrt(-5) { error }
Predicate Functions
There are three predicate functions in HP Pascal. They are odd, eof, and
eoln. The functions eof and eoln are described in Chapter 10 of this
manual.
odd
Usage
odd
(x)
Argument
x
Any integer expression.
Description
This function returns true if the integer expression is odd, and false
otherwise.
Example
Input Result
odd(int_var) depends on value of int_var
odd(ord(color)) depends on value of color
odd(2 + 4) false
odd(-32767) true
odd(32768) false
odd(0) false