QUICK REFERENCE
|
Useful
Pascal arithmetic functions
|
|||
| Commonly used arithmetic functions | |||
| Pascal function | Argument type | Function type | Function operation |
|---|---|---|---|
| sqrt(x) | integer or real | real | returns the square root of x (x >= 0) |
| random(x) | integer | integer | returns a random whole number between 0 and (x - 1) inclusive |
| abs(x) | integer or real | same as argument | returns the absolute value of x (i.e. |x| ) |
| round(x) | integer or real | integer | returns the value of x rounded to the nearest integer |
| trunc(x) | integer or real | integer | returns the integer formed by removing the fractional part of x |
| Other useful arithmetic functions | |||
| Pascal function | Argument type | Function type | Function operation |
| sqr(x) | integer or real | same as argument | returns the square of x, i.e. x2 |
| sin(x) | integer or real | real | returns the sine of x (in radians), i.e. sin x |
| cos(x) | integer or real | real | returns the cosine of x (in radians), i.e. cos x |
| arctan(x) | integer or real | real | returns the inverse tangent of x (result in radians), i.e. tan-1 x |
| ln(x) | integer or real | real | returns the natural logirithm of x, i.e. ln x |
| exp(x) | integer or real | real | returns the value of ex |
EXERCISE
|
|
|
|
|
|
|
|
|
|
|
Sell Disks
|
|||
|
Letter
|
|||
|
|
|
|
|
|
Age
|