Skip to main content

Knowledge Base

Function list: General purpose routines (Math387)

Math387 function list

Delphi math unit has been extended with many new routines

All listed functions from Math387 unit support real and complex numbers (where appropriate). Most functions for math in Delphi are now overloaded, to minimize the number of parameters required and function names to remember. All functions are capable of handling NAN and INF values and use of FWAIT instruction is therefore omitted, thus providing further performance gains. The unit also declares a large subset of typed constants for real and complex arithmetics. It supports both double and single floating point precision. Most of the function's were rewritten in assembly language (as the name 387 suggests). The performance gains are especially large for functions taking complex arguments. This unit does not provide any vector/matrix arithmetics (routines working on arrays of elements) and therefore can not make use of MMX/MMX2/SSE/SSE2/3DNOW. Some of the routines do not save intermediate results to memory, thus preserving full 80 bit (20 decimal places) precision. This improves the precision accuracy of the final result by up to 5 decimal places with double precision. (for example from 10 to 15).

For comprehensive help file please see the online documentation of MtxVec for Delphi/C++ Builder or MtxVec for Visual Studio .NET

ArcCos Inverse cosine.
ArcCosh The inverse hyperbolic cosine.
ArcCot Inverse cotangent.
ArcCoth Inverse hyperbolic cotangent.
ArcCsc Inverse cosecant.
ArcCsch Inverse hyperbolic cosecant.
ArcSec Inverse secant.
ArcSech Inverse hyperbolic secant.
ArcSin Inverse sine.
ArcSinh The inverse hyperbolic sine.
ArcTan Inverse tangens.
ArcTan2 Inverse tangens of Y/X.
ArcTanh The inverse hyperbolic tangens.
Arg The argument of Z.
BesselI0 Modified bessel function of the first kind.
BesselJ0 Bessel function of the first kind.
Bigger Compares two numbers.
BiggerOrEqual Compares two numbers.
CAbs The norm of Z.
CAbs1 Returns the approximation of the norm of Z.
CAdd Complex addition.
CAddI Add imaginary value BI to complex number A.
CartToPolar Cartesian to polar coordinate transformation.
CDiv Complex division.
Ceil Round towards positive infinity.
CFrac Complex frac function.
CheckRange Check the value.
CInv The 1/Z.
ClearFPU Clears pending FPU exceptions.
CMul Complex multipliction.
CMulI Multiply two complex numbers.
Conj Conjugate complex number.
Cos Cosine.
Cosh Hyperbolic cosine.
Cot Cotangent.
Coth Hyperbolic cotangent.
Cplx Converts two real numbers to complex number.
CplxToStr Converts complex number to a string.
CRound Complex round function.
Csc Cosecant.
Csch Hyperbolic cosecant.
CSqr The square of complex number.
CSqrt Square root of a complex number.
CSub Complex subtraction.
CSubI Subtract imaginary value BI from complex number A.
CTrunc Complex truncate function.
DegToRad Returns the value of a degree measurement expressed in radians.
EInvalidArgumentRaise Procedure raises EMtxVecInvalidArgument exception.
EnsureRange Limits the value.
Equal Compares two numbers.
ERaise Procedure raises MtxVecException exception.
ERangeErrorRaise Procedure raises EMtxVecRangeError exception.
Exp e^x function.
Exp10 10^x function.
Exp2 2^x function.
Expj Euler formula for complex number.
ExtractCplx A complex number, extracted from string source.
ExtractSample A TSample number, extracted from string source.
Fact Factorial N!.
FixAngle Sets angle in [-2p,2p] .
Flip Swaps real and imaginary part.
FlipConj Swaps real and imaginary part and conjugates the result.
Floor Round towards negative infinity.
FormatCplx The complex number Z formated as a string.
FormatSample The TSample number X formated as string.
Gamma Gamma function.
Gcd Greatest common divisor.
Imag Imaginary part of complex number.
IntPower Power function (integer power).
IsInf Checks if number is INF.
IsInfNan Checks if number is INF or NAN.
IsNan Checks if number is NAN.
IsNanInf Checks if number is INF or NAN.
LargestExp2 Returns first number being power of two that is equal or greater than n.
LargestLog2 Returns power of two which gives the first number that is equal or greater then n.
Lcm Smallest common multiplier.
LimitRange Limit the range X.
Ln Natural logarithm.
LnGamma Natural logarithm of the gamma function.
Log10 Log base 10.
Log2 Log base 2.
LogN Log base N.
Max Maximum of two numbers.
Min Minimum of two numbers.
MulI Multiplies complex number with I.
Neg Changes the sign of Z.
Norm The ||Z||^2.
PolarToCart Polar to cartesian coordinate transformation.
Power Power function.
Pythag The Pythagora formula.
RadToDeg Converts radians to degrees.
Real Real part of complex number.
Rem The reminder after division.
RestoreRound Restores FPU round flags.
Root The root of complex number.
SampleToStr Converts TSample value to a string.
Sec Secant.
Sech Hyperbolic secant.
SetRoundToTrunc Sets FPU rounding flags.
Sgn Signum.
Sign Fortran sign function.
Sin Sine.
SinCos Sine and cosine in single pass.
Sinh Hyperbolic sine.
SinhCosh The hyperbolic sine and cosine.
Smaller Compares two numbers.
SmallerOrEqual Compares two numbers.
StrToCplx Converts a string to complex number.
StrToSample Converts string to a TSample (double) value.
StrToVal Converts string to a value.
Swap Exchange two numbers.
Tan Tangens.
Tanh Hyperbolic tangens.
TruncAndFrac Splits the floating point number to integer and fractional parts.