
Double click on the target icon. The following window will appear:

Click on 'Code Generation-68K Processor' in the 'Target Settings Panels' window. Select 'PalmOS' in the 'Floating Point:' field.

Click on the 'Save' button.
I found this file in
Don't forget to transfer the MathLib.prc file to the Pilot before you debug or run your code.
After you unzip Rick's archive, you'll find "MathLib.c" in the "src" directory. You'll need to add it to your project. The "Files" tab in the project window should look something like:

Drag and drop the "MathLib.c" icon

Onto the "AppSource" folder in the project window:

Make sure you're dragging "MathLib.c" and not "MathLib.h" for this operation.
From Rick's User's Manual, put this code or something like it in your StartApplication( ) routine or equivalent:
And this code or something like it in your StopApplication( ) routine or equivalent:
You can now use IEEE math functions a la my previous example:
| Trigonometric functions | |
|---|---|
| acos(x) | Arc cosine of x |
| asin(x) | Arc sine of x |
| atan(x) | Arc tangent of x |
| atan2(y, x) | Arc tangent of y/x |
| cos(x) | Cosine of x |
| sin(x) | Sine of x |
| tan(x) | Tangent of x |
| sincos(x, *sinx, *cosx) | Sine and cosine of x |
| Hyperbolic functions | |
| cosh(x) | Hyperbolic cosine of x |
| sinh(x) | Hyperbolic sine of x |
| tanh(x) | Hyperbolic tangent of x |
| acosh(x) | Hyperbolic arc cosine of x |
| asinh(x) | Hyperbolic arc sine of x |
| atanh(x) | Hyperbolic arc tangent of x |
| Exponential and logarithmic functions | |
| exp(x) | Exponential function of x [pow(e,x)] |
| frexp(x,*exponent) | Break x into normalized fraction and an integral power of 2 |
| ldexp(x, exponent) | x * pow(2,exponent) |
| log(x) | Natural logarithm of x |
| log10(x) | Base 10 logarithm of x |
| modf(x, *intpart) | Break x into integral and fractional parts |
| expm1(x) | exp(x) - 1 |
| log1p(x) | log(1+x) |
| logb(x) | Base 2 signed integral exponent of x |
| log2(x) | Base 2 logarithm of x |
| Power functions | |
| pow(x, y) | x to the y power [x**y] |
| sqrt(x) | Square root of x [x**0.5] |
| hypot(x, y) | sqrt(x*x + y*y) [hypotenuse of right triangle] |
| cbrt(x) | Cube root of x [x**(1/3)] |
| Nearest integer, absolute value, and remainder functions | |
| ceil(x) | Smallest integral value not less than x |
| fabs(x) | Absolute value of x |
| floor(x) | Largest integral value not greater than x |
| fmod(x, y) | Modulo remainder of x/y |
| Miscellaneous functions | |
| isinf(x) | Return 0 if x is finite or NaN, +1 if +Infinity, or -1 if -Infinity |
| finite(x) | Return nonzero if x is finite and not NaN |
| scalbn(x, exponent) | x * pow(2,exponent) |
| drem(x, y) | Remainder of x/y |
| significand(x) | Fractional part of x after dividing out ilogb(x) |
| copysign(x, y) | Return x with its sign changed to match y's |
| isnan(x) | Return nonzero if x is NaN (Not a Number) |
| ilogb(x) | Binary exponent of non-zero x |
| rint(x) | Integral value nearest x in direction of prevailing rounding mode |
| nextafter(x, y) | Next machine value after x in the direction towards y |
| remainder(x, y) | Remainder of integer division x/y with infinite precision |
| scalb(x, exponent) | x * pow(2,exponent) |
| round(x) | Round x to nearest integral value away from zero |
| trunc(x) | Round x to nearest integral value not larger than x |
| signbit(x) | Return signbit of x's machine representation |
Craig Niederberger, June 2000