HP Pascal/iX Reference Manual (31502-90022)
Table Of Contents
- Top of Document
- Preface
- Chapter 1 Introduction
- Chapter 2 Language Elements
- Chapter 3 Data Types
- Chapter 4 Expressions
- Chapter 5 The Declaration Section
- Chapter 6 Statements
- Chapter 7 Program Structure
- Chapter 8 Procedures and Functions
- Chapter 9 Standard Routines
- Chapter 10 Input and Output
- Chapter 11 System Programming Extensions
- Chapter 12 Compiler Options
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