Math libraries for Atari

Currently, there are two free math libraries available for Atari ST, PML (Portable Math Library), and fdlibm. The following table should give a brief overview over which functions are available.

 

PMLfdlibm
Name DoubleFloatLong Double DoubleFloatLong Double Description Comments
Trigonometric functions.
acosyesnonoyesnonoArc cosine of X.
asinyesnonoyesnonoArc sine of X.
atanyesnonoyesnonoArc tangent of X.
atan2yesnonoyesnonoArc tangent of Y/X.
cosyesnonoyesnonoCosine of X.
sinyesnonoyesnonoSine of X.
tanyesnonoyesnonoTangent of X.
sincosnonononononoCosine and sine of X.
Hyperbolic functions.
coshyesnonoyesnonoHyperbolic cosine of X.
sinhyesnonoyesnonoHyperbolic sine of X.
tanhyesnonoyesnonoHyperbolic tangent of X.
acoshyesnonoyesnonoHyperbolic arc cosine of X.
asinhyesnonoyesnonoHyperbolic arc sine of X.
atanhyesnonoyesnonoHyperbolic arc tangent of X.
Exponential and logarithmic functions.
expyesnonoyesnonoExponential function of X.when using PML, you may get unresolved externals when using the softfloat function, because ldexp and frexp are not implemented
exp2nonononononoCompute base-2 exponential of X.
exp10yesnononononoCompute exponent to base ten.Same as pow10()
logyesnonoyesnonoNatural logarithm of X.
log2nonononononoCompute base-2 logarithm of X.
log10yesnonoyesnonoBase-ten logarithm of X.
frexpnononoyesnonoBreak VALUE into a normalized fraction and an integral power of 2.implemented in mintlib
ldexpnononoyesnonoX times (two to the EXP power).implemented in mintlib
modfnononoyesnonoBreak VALUE into integral and fractional parts.
expm1nononoyesnonoReturn exp(X) - 1.
log1pnononoyesnonoReturn log(1 + X).
logbnononoyesnonoReturn the base 2 signed integral exponent of X.
Power functions.
powyesnonoyesnonoReturn X to the Y power.
pow10nonononononoReturn the value of 10 raised to the power xSame as exp10()
sqrtyesnonoyesnonoReturn the square root of X.when using PML, you may get unresolved externals when using the softfloat function, because frexp is not implemented
hypotnononoyesnonoReturn sqrt(X*X + Y*Y).
cbrtnononoyesnonoReturn the cube root of X.
Nearest integer, absolute value, and remainder functions.
ceilyesnonoyesnonoSmallest integral value not less than X.when using PML, you may get unresolved externals when using the softfloat function, because modf is not implemented
fabsyesyesnoyesyesnoAbsolute value of X.
flooryesnonoyesnonoLargest integer not greater than X.when using PML, you may get unresolved externals when using the softfloat function, because modf is not implemented
fmodyesnonoyesnonoFloating-point modulo remainder of X/Y.
finitenononoyesyesyesReturn nonzero if VALUE is finite and not NaN.implemented in mintlib
dremnononoyesnonoReturn the remainder of X/Y.Obsolete synonym for remainder
significandnononoyesnonoReturn the fractional part of X after dividing out `ilogb (X)'.
copysignyesnonoyesnonoReturn X with its signed changed to Y's.
nannonononononoReturn representation of qNaN for double type.
Bessel functions.
j0nononoyesnonoBessel function of the first kind of order 0
j1nononoyesnonoBessel function of the first kind of order 1
jnnononoyesnonoBessel function of the first kind of order n
y0nononoyesnonoBessel function of the second kind of order 0
y1nononoyesnonoBessel function of the second kind of order 1
ynnononoyesnonoBessel function of the second kind of order n
Error and gamma functions.
erfnononoyesnonoerror function
erfcnononoyesnonocomplementary error function
lgammanononoyesnonolog gamma function
tgammanononoyesnonotrue gamma function
gammanononoyesnono(logarithm of the) gamma function
lgamma_rnononoyesnonoreentrant version of lgamma
ISO C99 rounding functions.
rintyesnonoyesnonoReturn the integer nearest X in the direction of the prevailing rounding mode.when using PML, you may get unresolved externals when using the softfloat function, because modf is not implemented
nextafternononoyesnonoReturn X + epsilon if X < Y, X - epsilon if X > Y.
nexttowardnonononononoReturn X + epsilon if X < Y, X - epsilon if X > Y.
nextdownnonononononoreturn next floating-point number toward negative infinity
nextupnonononononoreturn next floating-point number toward positive infinity
remaindernononoyesnonoReturn the remainder of integer divison X / Y with infinite precision.
scalbnononoyesnonoReturn X times (2 to the Nth power).
scalbnnononoyesnonoReturn X times (2 to the Nth power).
scalblnnonononononoReturn X times (2 to the Nth power).
ilogbnononoyesnonoReturn the binary exponent of X, which must be nonzero.
llogbnonononononoLike ilogb, but returning long int.
nearbyintnonononononoRound X to integral value in floating-point format using current rounding direction, but do not raise inexact exception.Same as rint
roundyesnonoyesnonoRound X to nearest integral value, rounding halfway cases away from zero.
truncnonononononoRound X to the integral value in floating-point format nearest but not larger in magnitude.
remquononononononoCompute remainder of X and Y and put in *QUO a value with sign of x/y and magnitude congruent `mod 2^n' to the magnitude of the integral quotient x/y, with n >= 3.
Conversion functions.
lrintnonononononoRound X to nearest integral value according to current rounding direction.
llrintnonononononoLike lrint, but returning long long int.
lroundnonononononoRound X to nearest integral value, rounding halfway cases away from zero.
llroundnonononononoLike lround, but returning long long int.
fdimnonononononoReturn positive difference between X and Y.
fmaxnononoyesnonoReturn maximum numeric value from X and Y.
fminnononoyesnonoReturn minimum numeric value from X and Y.
fmanonononononoMultiply-add function computed as a ternary operation.
roundevennonononononoRound X to nearest integer value, rounding halfway cases to even.
fromfpnonononononoRound X to nearest signed integer value, not raising inexact, with control of rounding direction and width of result.
ufromfpnonononononoRound X to nearest unsigned integer value, not raising inexact, with control of rounding direction and width of result.
fromfpxnonononononoRound X to nearest signed integer value, raising inexact for non-integers, with control of rounding direction and width of result.
ufromfpxnonononononoRound X to nearest unsigned integer value, raising inexact for non-integers, with control of rounding direction and width of result.
Classification functions.
fpclassifynononoyesnonoReturn number of classification appropriate for X.
signbityesyesyesyesyesyesReturn nonzero value if sign of X is negative.implemented in mintlib
isfiniteyesyesyesyesyesyesReturn nonzero value if X is not +-Inf or NaN.implemented in mintlib
isnormalnonononononoReturn nonzero value if X is neither zero, subnormal, Inf, nor NaN.
isnanyesyesyesyesyesyesReturn nonzero if VALUE is not a number.implemented in mintlib
isinfyesyesyesyesyesyesReturn 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity.implemented in mintlib
issignalingnonononononoReturn nonzero value if X is a signaling NaN.
issubnormalnonononononoReturn nonzero value if X is subnormal.
iszerononononononoReturn nonzero value if X is zero.
iscanonicalnonononononoReturn nonzero value if X is canonical.
relational tests without exception for NaN.
isgreaternonononononodetermines (x) > (y) without an exception if x or y is NaN.
isgreaterequalnonononononodetermines (x) >= (y) without an exception if x or y is NaN.
islessnonononononodetermines (x) < (y) without an exception if x or y is NaN.
islessequalnonononononodetermines (x) <= (y) without an exception if x or y is NaN.
islessgreaternonononononodetermines (x) < (y) || (x) > (y) without an exception if x or y is NaN. This macro is not equivalent to x != y because that expression is true if x or y is NaN.
isunorderednonononononodetermines whether its arguments are unordered, that is, whether at least one of the arguments is a NaN.
iseqsignonononononoReturn X == Y but raising "invalid" and setting errno if X or Y is a NaN.
Miscellaneous functions.
fmaxmagnonononononoReturn value with maximum magnitude.
fminmagnonononononoReturn value with minimum magnitude.
totalordernonononononoTotal order operation.
totalordermagnonononononoTotal order operation on absolute values.
canonicalizenonononononoCanonicalize floating-point representation.
getpayloadnonononononoGet NaN payload.
setpayloadnonononononoSet quiet NaN payload.
setpayloadsignonononononoSet signaling NaN payload.
matherryesyesSVID math library exception handlingDeprecated in favour of math_error
math_errornonodetecting errors from mathematical functions
Exception handling.
feclearexceptnonoClear the supported exceptions represented by EXCEPTS.
fegetexceptflagnonoStore implementation-defined representation of the exception flags indicated by EXCEPTS in the object pointed to by FLAGP.
feraiseexceptnonoRaise the supported exceptions represented by EXCEPTS.
fesetexceptnonoSet the supported exception flags represented by EXCEPTS, without causing enabled traps to be taken.
fetestexceptnonoDetermine which of subset of the exceptions specified by EXCEPTS are currently set.
fetestexceptflagnonoDetermine which of subset of the exceptions specified by EXCEPTS are set in *FLAGP.
feenableexceptnonoEnable individual exceptions. Will not enable more exceptions than EXCEPTS specifies. Returns the previous enabled exceptions if all exceptions are successfully set, otherwise returns -1.
fedisableexceptnonoDisable individual exceptions. Will not disable more exceptions than EXCEPTS specifies. Returns the previous enabled exceptions if all exceptions are successfully disabled, otherwise returns -1.
fegetexceptnonoReturn enabled exceptions.
Rounding control.
fegetroundnonoGet current rounding direction.
fesetroundnonoEstablish the rounding direction represented by ROUND.
Floating-point environment.
fegetenvnonoStore the current floating-point environment in the object pointed to by ENVP.
feholdexceptnonoSave the current environment in the object pointed to by ENVP, clear exception flags and install a non-stop mode (if available) for all exceptions.
fesetenvnonoEstablish the floating-point environment represented by the object pointed to by ENVP.
feupdateenvnonoSave current exceptions in temporary storage, install environment represented by object pointed to by ENVP and raise exceptions according to saved exceptions.
Control modes.
fegetmodenonoStore the current floating-point control modes in the object pointed to by MODEP.
fesetmodenonoEstablish the floating-point control modes represented by the object pointed to by MODEP.
Complex Trigonometric functions.
cacosyesnononononoArc cosine of X.
casinyesnononononoArc sine of X.
catanyesnononononoArc tangent of X.
ccosyesnononononoCosine of X.
csinyesnononononoSine of X.
ctanyesnononononoTangent of X.
Complex Hyperbolic functions.
ccoshyesnononononoHyperbolic cosine of X.
csinhyesnononononoHyperbolic sine of X.
ctanhyesnononononoHyperbolic tangent of X.
cacoshnonononononoHyperbolic arc cosine of X.
casinhnonononononoHyperbolic arc sine of X.
catanhnonononononoHyperbolic arc tangent of X.
Complex Exponential and logarithmic functions.
cexpyesnononononoExponential function of X.
clogyesnononononoNatural logarithm of X.
clog10nonononononoBase-ten logarithm of X.
Complex Power functions.
cpownonononononoReturn X to the Y power.
csqrtyesnononononoReturn the square root of X.
crcpyesnononononocomplex reciprocal of zNon-standard function
Absolute value, conjugates, and projection.
cabsyesnononononoAbsolute value of Z.
cargnonononononoArgument value of Z.
conjnonononononoComplex conjugate of Z.
cprojnonononononoProjection of Z onto the Riemann sphere.
cimagnonononononoImaginary part of Z.
crealnonononononoReal part of Z.

Home