📄 mathalib.s
字号:
* floatLib (1), "The C Programming Language - Second Edition"* double fabs (dblParam)* double dblParam; /* argument **/ .balign 16,0x90FUNC_LABEL(fabs) movl FUNC(mathFabsFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* floor - ANSI-compatable floating-point floor** Performs a 'round-to-negative-infinity'.** RETURNS: * The largest integral value less than or equal to dblParam,* result is returned in double precision.** SEE ALSO: * floatLib (1), "The C Programming Language - Second Edition"** double floor (dblParam)* double dblParam; /* argument **/ .balign 16,0x90FUNC_LABEL(floor) movl FUNC(mathFloorFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* fmod - ANSI-compatable floating-point modulus ** RETURNS: * Floating-point modulus of (dblParam / dblDivisor) with the sign of dblParam. ** SEE ALSO: * floatLib (1), "The C Programming Language - Second Edition"* double fmod (dblParam, dblDivisor)* double dblParam; /* argument ** double dblDivisor; /* divisor **/ .balign 16,0x90FUNC_LABEL(fmod) movl FUNC(mathFmodFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* hypot - double-precision Euclidean distance (hypotenuse)** This routine takes two input double-precision floating point* parameters and returns length of the corresponding Euclidean distance* (hypotenuse).** The distance is calculated as* sqrt ((dblX * dblX) + (dblY * dblY))** RETURNS: double-precision hypotenuse.** double hypot (dblX, dblY)* double dblX; /* argument ** double dblY; /* argument **/ .balign 16,0x90FUNC_LABEL(hypot) movl FUNC(mathHypotFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* infinity - return a very large double** SEE ALSO: floatLib(1) * double infinity ()*/ .balign 16,0x90FUNC_LABEL(infinity) movl FUNC(mathInfinityFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* irint - convert double to integer** Convert dblParam to an integer using the selected IEEE* rounding direction.** CAVEAT:* The rounding direction is not pre-selectable* and is fixed for 'round-to-the-nearest'.** SEE ALSO: floatLib (1) * int irint (dblParam)* double dblParam; /* argument **/ .balign 16,0x90FUNC_LABEL(irint) movl FUNC(mathIrintFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* iround - INTEGER floating-point rounding** Performs a 'round-to-the-nearest' function.** NOTE:* If dblParam is spaced evenly between two integers,* then the even integer will be returned.* int iround (dblParam)* double dblParam; /* argument **/ .balign 16,0x90FUNC_LABEL(iround) movl FUNC(mathIroundFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* log - ANSI-compatable floating-point natural logarithm ** RETURNS: The natural logarithm of dblParam.** SEE ALSO: * floatLib (1), "The C Programming Language - Second Edition"* double log (dblParam)* double dblParam; /* argument **/ .balign 16,0x90FUNC_LABEL(log) movl FUNC(mathLogFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* log10 - ANSI-compatable floating-point logarithm base 10 ** RETURNS: The logarithm (base 10) of dblParam.** SEE ALSO: floatLib (1), log2 (2)* double log10 (dblParam)* double dblParam; /* argument **/ .balign 16,0x90FUNC_LABEL(log10) movl FUNC(mathLog10Func),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* log2 - ANSI-compatable floating-point logarithm base 2 ** RETURNS: The logarithm (base 2) of dblParam.** SEE ALSO: floatLib (1), log10 (2)* double log2 (dblParam)* double dblParam; /* argument **/ .balign 16,0x90FUNC_LABEL(log2) movl FUNC(mathLog2Func),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* pow - ANSI-compatable floating-point dblX to the power of floating-point dblY ** RETURNS: The floating-point value of dblX to the power of dblY.** SEE ALSO: floatLib (1), sqrt (2)* double pow (dblX, dblY)* double dblX; /* X ** double dblY; /* X **/ .balign 16,0x90FUNC_LABEL(pow) /* pow (x,y) = exp (y * log(x)) */ movl FUNC(mathPowFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* round - floating-point rounding** Performs a 'round-to-nearest'.** SEE ALSO: floatLib (1)* double round (dblParam)* double dblParam; /* argument **/ .balign 16,0x90FUNC_LABEL(round) movl FUNC(mathRoundFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* sin - ANSI-compatable floating-point sine** RETURNS: The floating-point sine of dblParam.** SEE ALSO: * floatLib (1), cos (2), tan (2), * "The C Programming Language - Second Edition"* double sin (dblParam)* double dblParam; /* angle in radians **/ .balign 16,0x90FUNC_LABEL(sin) movl FUNC(mathSinFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* sincos - simultaneous floating-point sine and cosine** RETURNS:* The simultaeous floating point results of sine and cosine of the * radian argument The dblParam must be in range of -1.0 to +1.0.*** SEE ALSO: floatLib (1), "i80387 Floating-Point User's Manual"* void sincos (dblParam, sinResult, cosResult)* double dblParam; /* angle in radians ** double *sinResult; /* sine result buffer ** double *cosResult; /* cosine result buffer **/ .balign 16,0x90FUNC_LABEL(sincos) movl FUNC(mathSincosFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* sqrt - ANSI-compatable floating-point square root** RETURNS: The floating-point square root of dblParam.** SEE ALSO: floatLib(1), pow (2)* double sqrt (dblParam)* double dblParam; /* argument **/ .balign 16,0x90FUNC_LABEL(sqrt) movl FUNC(mathSqrtFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* tan - ANSI-compatable floating-point tangent** RETURNS: Floating-point tangent of dblParam.** SEE ALSO: floatLib (1), cos (2), sin (2),* "The C Programming Language - Second Edition"* double tan (dblParam)* double dblParam; /* angle in radians **/ .balign 16,0x90FUNC_LABEL(tan) movl FUNC(mathTanFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* trunc - floating-point truncation** Performs FINTRZ.** RETURNS:* The integer portion of a double-precision number,* result is in double-precision.** SEE ALSO: floatLib (1)* double trunc (dblParam)* double dblParam; /* argument **/ .balign 16,0x90FUNC_LABEL(trunc) movl FUNC(mathTruncFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* facos - single-precision floating-point arc-cosine** RETURNS: The arc-cosine in the range -pi/2 to pi/2 radians.* float facos (fltParam)* float fltParam; /* angle in radians **/ .balign 16,0x90FUNC_LABEL(facos) movl FUNC(mathFacosFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* fasin - single-precision floating-point arc-sine** RETURNS: The arc-sine in the range 0.0 to pi radians.* * SEE ALSO: * floatLib (1), "The C Programming Language - Second Edition"* float fasin (fltParam)* float fltParam; /* angle in radians **/ .balign 16,0x90FUNC_LABEL(fasin) movl FUNC(mathFasinFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* fatan - single-precision floating-point arc-tangent** RETURNS: The arc-tangent of fltParam in the range -pi/2 to pi/2.** SEE ALSO: floatLib (1), acos (2), asin (2)* float fatan (fltParam)* float fltParam; /* angle in radians **/ .balign 16,0x90FUNC_LABEL(fatan) movl FUNC(mathFatanFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* fatan2 - function returns the arc tangent of (fltY/fltX) ** RETURNS:* The arc-tangent of (fltY/fltX) in the range -pi to pi.** SEE ALSO: * floatLib (1), "The C Programming Language - Second Edition"* float fatan2 (fltY, fltX)* float fltY; /* Y ** float fltX; /* X **/ .balign 16,0x90FUNC_LABEL(fatan2) movl FUNC(mathFatan2Func),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* fcbrt - single-precision floating-point cube root** This routine takes a single-precision floating point parameter* and returns the single-precision cube root.** RETURNS: single-precision cube root* float fcbrt (fltParam)* float fltParam; /* argument **/ .balign 16,0x90FUNC_LABEL(fcbrt) movl FUNC(mathFcbrtFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* fceil - single-precision floating-point ceiling** Performs a 'round-to-positive-infinity'** RETURNS: * The least integral value greater than or equal to fltParam,* result is returned in single precision.** SEE ALSO: * floatLib (1), "The C Programming Language - Second Edition"* float fceil (fltParam)* float fltParam; /* argument **/ .balign 16,0x90FUNC_LABEL(fceil) movl FUNC(mathFceilFunc),%eax jmp *%eax /* jump, let that routine rts *//********************************************************************************* fcos - single-precision floating-point cosine** RETURNS: the cosine of the radian argument fltParam** SEE ALSO:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -