• egg

## Documentation

Provides access to ISO C math functions in <math.h> that are not defined by the Chicken core. Please refer to your documentation for <math.h> for a description of the various calls.

### Math Functions

O is a fixnum.

P2 is an integer.

N, M, N1, N2 are float.

#### Usage

`(import "mathh")`

#### bessel-yn

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

#### cosh

[procedure] (cosh N) --> float

#### sinh

[procedure] (sinh N) --> float

#### tanh

[procedure] (tanh N) --> float

#### acosh

[procedure] (acosh N) --> float

#### asinh

[procedure] (asinh N) --> float

#### atanh

[procedure] (atanh N) --> float

#### hypot

[procedure] (hypot N1 N2) --> float

#### gamma

[procedure] (gamma N) --> float

#### lgamma

[procedure] (lgamma N) --> float

#### erf

[procedure] (erf N) --> float

#### erfc

[procedure] (erfc N) --> float

#### log10

[procedure] (log10 N) --> float

#### log2

[procedure] (log2 N) --> float

#### log1p

[procedure] (log1p N) --> float

#### log/base

[procedure] (log-with-base N) --> (procedure (float) float)
[procedure] (log/base N) --> (procedure (float) float)

Returns a function for the logarithm of base N.

#### ldexp

[procedure] (ldexp N P2) --> float

#### scalbn

[procedure] (scalbn N P2) --> float

#### cbrt

[procedure] (cbrt N) --> float

#### nextafter

[procedure] (nextafter N M) --> float

Returns the next N in the direction of M.

#### fpmod

[procedure] (fpmod N M) --> float

Returns the modulus of N for M.

#### modf*

[procedure] (modf N) --> float float
[procedure] (modf* N) --> integer float

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

#### frexp

[procedure] (frexp N) --> float float

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

#### signbit

[procedure] (signbit N) --> boolean

Returns #t when negative, #f otherwise.

#### copysign

[procedure] (copysign N M) --> float

Returns N with same sign as M.

#### fpclassify

[procedure] (fpclassify N) --> symbol

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

infinite
nan
normal
subnormal
zero
unclassified

#### fpclass

[procedure] (fpclass N) --> symbol

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

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

### Math Constants (Module)

#### Usage

`(import mathh-consts)`

#### Constants

These are all float.

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)

### Math Constants (Include)

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

#### Usage

`(include "mathh-constants")`

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)