06.A Arithmetic Functions

 

Some of the arithmetic and trigonometric functions are implemented in NS Basic/Palm using a shared library called MathLib which is distributed with NS Basic/Palm. MathLib is a free shared library that can be used by any Palm OS program that needs IEEE 754 double precision math functions. It's distributed under the terms of the GNU General Public License, and is freely available with full source code and documentation at the

http://www.radiks.net/~rhuebner/mathlib.html information web page. It's not a part of the NS Basic/Palm itself, but it is included in the Lib folder on your desktop. Mathlib's information is precompiled into NS Basic/Palm. There is no need for a .inf file or a LoadLibrary statement to use these functions.

 

The arithmetic functions that use MathLib are marked below with two asterisks(**). If you use any of these functions, then the Palm OS devices your program executes on must have MathLib (MathLib.prc).

Abs

Returns the absolute value of an arithmetic expression

Cbrt

Returns the cube root of a number**

Ceiling

Returns the next higher integer number than a given arithmetic expression

Exp

Returns the exponential of a number**

Floor

Returns the next lower integer number than a given arithmetic expression

Int

Returns the integer value of an arithmetic expression

Log

Returns the natural log of a number**

Log10

Returns the base 10 log of a number**

Mod

Returns the remainder of one arithmetic expression divided by another

Pow

Returns the result of one number raised to the power of a second number**

Power10

Returns the result of raising a number to the specified power of 10 **

Rem

Returns the remainder of dividing one number by another number**

Round

Rounds the results of an arithmetic expression up to the nearest fractional digit

Sign

Returns an indicator of the sign (positive or negative) of an arithmetic expression

Sqrt

Returns the square root of an arithmetic expression**

Trunc

Returns a float with decimal places truncated