You are looking at historical revision 13569 of this page. It may differ significantly from its current revision.

• egg

## Documentation

Provides access to ISO C math functions in <math.h> that are not defined by the Chicken core.

### Floating-point Functions

The following procedures are provided, with their usual meaning:

N, N1, N2 are double.

O, P2} are {{integer.

#### bessel-yn

[procedure] (bessel-j0 N) => NUMBER
[procedure] (bessel-j1 N) => NUMBER
[procedure] (bessel-jn O N) => NUMBER
[procedure] (bessel-y0 N) => NUMBER
[procedure] (bessel-y1 N) => NUMBER
[procedure] (bessel-yn O N) => NUMBER

The Bessel functions are prefixed by 'bessel-' to distinguish the names from common variables.

#### hypot

[procedure] (cosh N) => NUMBER
[procedure] (sinh N) => NUMBER
[procedure] (tanh N) => NUMBER
[procedure] (hypot N1 N2) => NUMBER

#### lgamma

[procedure] (gamma N) => NUMBER
[procedure] (lgamma N) => NUMBER

gamma and lgamma are unavailable on Windows.

#### log1p

[procedure] (log10 N) => NUMBER
[procedure] (log2 N) => NUMBER
[procedure] (log1p N) => NUMBER

log1p is potentially inaccurate on Windows.

#### scalbn

[procedure] (ldexp N P2) => NUMBER
[procedure] (scalbn N P2) => NUMBER

scalbn is inefficient on Windows.

#### make-log/base

[procedure] (make-log/base BASE) => PROCEDURE/1-NUMBER

Returns a procedure of one argument, the logarithm function for BASE.

BASE is a number.

#### fpmod

[procedure] (fpmod N M) => NUMBER

Returns the modulus of N for M.

N and M are double.

#### modf

[procedure] (modf N) => (values NUMBER NUMBER)

Returns two values, the integral and fractional components of N.

N is double.

#### frexp

[procedure] (frexp N) => (values NUMBER NUMBER)

Returns two values, the fraction and the exponent components of N.

N is double.

### Float Classification

(procedure (fpclassify N))

Returns a symbol denoting the floating-point kind of N.

N is double.

infinite
nan
normal
subnormal
zero
unclassified

(procedure (fpclass N))

Returns a symbol denoting the floating-point kind of N.

N is double.

positive-infinite
negative-infinite
quiet-nan
signaling-nan
positive-normal
negative-normal
positive-subnormal
negative-subnormal
positive-zero
negative-zero
unclassified

### Math Constants

Common constants, using 'define-constant'. As such they must be textually included.

E
e
1/E
1/e
E^2
e^2
E^PI/4
e^(pi/4)
LOG2E
log2(e)
LOG10E
log10(e)
LN2
log(2)
LN3
ln(3)
LNPI
ln(pi)
LN10
log(10)
1/LN2
1/ln(2)
1/LN10
1/ln(10)
PI
pi
PI/2
pi/2
PI/4
pi/4
1/PI
1/pi
2/PI
2/pi
2/SQRTPI
2/sqrt(pi)
SQRTPI
sqrt(pi)
PI^2
pi^2
DEGREE
pi/180
SQRT2
sqrt(2)
1/SQRT2
1/sqrt(2)
SQRT3
sqrt(3)
SQRT5
sqrt(5)
SQRT10
sqrt(10)
CUBERT2
cubert(2)
CUBERT3
cubert(3)
4THRT2
fourthrt(2)
GAMMA1/2
gamma(1/2)
GAMMA1/3
gamma(1/3)
GAMMA2/3
gamma(2/3)
PHI
phi
LNPHI
ln(phi)
1/LNPHI
1/ln(phi)
EULER
euler
E^EULER
e^euler
SIN1
sin(1)
COS1
cos(1)
ZETA3
theta(3

## Usage

### Math functions

```(require-library mathh)
(import mathh)```

or

`(require-extension mathh)`

### Math constants

`(include mathh-constants)`

## Version history

2.0.0
Chicken 4 release. fpclass and fpclassify are now part of the mathh extension.