diff -r ae6b11a3b4d5 -r 852e84340d2b LongFloat.st --- a/LongFloat.st Tue Jun 17 11:10:25 2003 +0200 +++ b/LongFloat.st Tue Jun 17 11:12:22 2003 +0200 @@ -902,298 +902,6 @@ !LongFloat methodsFor:'mathematical functions'! -arcCos - "return the arccosine of myself (I am interpreted as radians). - Raises an exception, if the receiver is not in -1..1" - -%{ /* NOCONTEXT */ -#if defined(LONG_acos) - - LONGFLOAT val, rslt; - OBJ newFloat; - - val = __longFloatVal(self); - -# ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */ - if ((val >= -1.0) && (val <= 1.0)) -# endif - { - __threadErrno = 0; - rslt = LONG_acos(val); -# ifdef LONG_isnan - if (! LONG_isnan(rslt)) -# endif - { - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } - } - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#arcCos - arguments:#() - errorString:'bad receiver in arcCos' - - " - -10 asLongFloat arcCos - 1 asLongFloat arcCos - 0.5 asLongFloat arcCos - " -! - -arcCosh - "return the hyperbolic arccosine of myself (I am interpreted as radians). - Raises an exception, if the receiver is not in -1..1" - -%{ /* NOCONTEXT */ -#if defined(LONG_acosh) - - LONGFLOAT val, rslt; - OBJ newFloat; - - val = __longFloatVal(self); - -# ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */ - if ((val >= -1.0) && (val <= 1.0)) -# endif - { - __threadErrno = 0; - rslt = LONG_acosh(val); -# ifdef LONG_isnan - if (! LONG_isnan(rslt)) -# endif - { - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } - } - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#arcCosh - arguments:#() - errorString:'bad receiver in arcCosh' - - " - -10 asLongFloat arcCosh - 1 asLongFloat arcCosh - 0.5 asLongFloat arcCosh - " -! - -arcSin - "return the arcsine of myself (I am interpreted as radians). - Raises an exception, if the receiver is not in -1..1" - -%{ /* NOCONTEXT */ -#if defined(LONG_asin) - - LONGFLOAT val, rslt; - OBJ newFloat; - - val = __longFloatVal(self); - -# ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */ - if ((val >= -1.0) && (val <= 1.0)) -# endif - { - __threadErrno = 0; - rslt = LONG_asin(val); -# ifdef LONG_isnan - if (! LONG_isnan(rslt)) -# endif - { - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } - } - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#arcSin - arguments:#() - errorString:'bad receiver in arcSin' - - " - -10 asLongFloat arcSin - 1 asLongFloat arcSin - 0.5 asLongFloat arcSin - " -! - -arcSinh - "return the hyperbolic arcsine of myself (I am interpreted as radians). - Raises an exception, if the receiver is not in -1..1" - -%{ /* NOCONTEXT */ -#if defined(LONG_asinh) - - LONGFLOAT val, rslt; - OBJ newFloat; - - val = __longFloatVal(self); - -# ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */ - if ((val >= -1.0) && (val <= 1.0)) -# endif - { - __threadErrno = 0; - rslt = LONG_asinh(val); -# ifdef LONG_isnan - if (! LONG_isnan(rslt)) -# endif - { - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } - } - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#arcSinh - arguments:#() - errorString:'bad receiver in arcSinh' - - " - -10 asLongFloat arcSinh - 1 asLongFloat arcSinh - 0.5 asLongFloat arcSinh - " -! - -arcTan - "return the arctangent of myself as radians" - -%{ /* NOCONTEXT */ -#if defined(LONG_atan) - - LONGFLOAT rslt; - OBJ newFloat; - - __threadErrno = 0; - rslt = LONG_atan(__longFloatVal(self)); -# ifdef LONG_isnan - if (! LONG_isnan(rslt)) -# endif - { - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#arcTan - arguments:#() - errorString:'bad receiver in arcTan' -! - -arcTanh - "return the hyperbolic arctangent of myself as radians" - -%{ /* NOCONTEXT */ -#if defined(LONG_atanh) - - LONGFLOAT rslt; - OBJ newFloat; - - __threadErrno = 0; - rslt = LONG_atanh(__longFloatVal(self)); -# ifdef LONG_isnan - if (! LONG_isnan(rslt)) -# endif - { - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#arcTanh - arguments:#() - errorString:'bad receiver in arcTanh' -! - -cos - "return the cosine of myself interpreted as radians" - -%{ /* NOCONTEXT */ -#if defined(LONG_cos) - - LONGFLOAT rslt; - OBJ newFloat; - - __threadErrno = 0; - rslt = LONG_cos(__longFloatVal(self)); -# ifdef LONG_isnan - if (! LONG_isnan(rslt)) -# endif - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#cos - arguments:#() - errorString:'bad receiver in cos' -! - -cosh - "return the hyperbolic cosine of myself interpreted as radians" - -%{ /* NOCONTEXT */ -#if defined(LONG_cosh) - - LONGFLOAT rslt; - OBJ newFloat; - - __threadErrno = 0; - rslt = LONG_cosh(__longFloatVal(self)); -# ifdef LONG_isnan - if (! LONG_isnan(rslt)) -# endif - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#cosh - arguments:#() - errorString:'bad receiver in cosh' -! - exp "return e raised to the power of the receiver" @@ -1343,62 +1051,6 @@ "Modified: / 16.11.2001 / 14:16:51 / cg" ! -sin - "return the sine of myself interpreted as radians" - -%{ /* NOCONTEXT */ -#if defined(LONG_sin) - - LONGFLOAT rslt; - OBJ newFloat; - - __threadErrno = 0; - rslt = LONG_sin(__longFloatVal(self)); -# ifdef LINUX /* and maybe others */ - if (! isnan(rslt)) -# endif - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#sin - arguments:#() - errorString:'bad receiver in sin' -! - -sinh - "return the hyperbolic sine of myself interpreted as radians" - -%{ /* NOCONTEXT */ -#if defined(LONG_sinh) - - LONGFLOAT rslt; - OBJ newFloat; - - __threadErrno = 0; - rslt = LONG_sinh(__longFloatVal(self)); -# ifdef LINUX /* and maybe others */ - if (! isnan(rslt)) -# endif - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#sinh - arguments:#() - errorString:'bad receiver in sinh' -! - sqrt "return the square root of myself. Raises an exception, if the receiver is less than zero." @@ -1442,62 +1094,6 @@ " "Modified: / 16.11.2001 / 14:14:43 / cg" -! - -tan - "return the tangens of myself interpreted as radians" - -%{ /* NOCONTEXT */ -#if defined(LONG_tan) - - LONGFLOAT rslt; - OBJ newFloat; - - __threadErrno = 0; - rslt = LONG_tan(__longFloatVal(self)); -# ifdef LINUX /* and maybe others */ - if (! isnan(rslt)) -# endif - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#tan - arguments:#() - errorString:'bad receiver in tan' -! - -tanh - "return the hyperbolic tangens of myself interpreted as radians" - -%{ /* NOCONTEXT */ -#if defined(LONG_tanh) - - LONGFLOAT rslt; - OBJ newFloat; - - __threadErrno = 0; - rslt = LONG_tanh(__longFloatVal(self)); -# ifdef LINUX /* and maybe others */ - if (! isnan(rslt)) -# endif - if (__threadErrno == 0) { - __qMKLFLOAT(newFloat, rslt); - RETURN ( newFloat ); - } -#endif -%}. - ^ self class - raise:#domainErrorSignal - receiver:self - selector:#tanh - arguments:#() - errorString:'bad receiver in tanh' ! ! !LongFloat methodsFor:'printing & storing'! @@ -1793,6 +1389,412 @@ %} ! ! +!LongFloat methodsFor:'trigonometric'! + +arcCos + "return the arccosine of myself (I am interpreted as radians). + Raises an exception, if the receiver is not in -1..1" + +%{ /* NOCONTEXT */ +#if defined(LONG_acos) + + LONGFLOAT val, rslt; + OBJ newFloat; + + val = __longFloatVal(self); + +# ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */ + if ((val >= -1.0) && (val <= 1.0)) +# endif + { + __threadErrno = 0; + rslt = LONG_acos(val); +# ifdef LONG_isnan + if (! LONG_isnan(rslt)) +# endif + { + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } + } + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#arcCos + arguments:#() + errorString:'bad receiver in arcCos' + + " + -10 asLongFloat arcCos + 1 asLongFloat arcCos + 0.5 asLongFloat arcCos + " +! + +arcCosh + "return the hyperbolic arccosine of myself (I am interpreted as radians). + Raises an exception, if the receiver is not in -1..1" + +%{ /* NOCONTEXT */ +#if defined(LONG_acosh) + + LONGFLOAT val, rslt; + OBJ newFloat; + + val = __longFloatVal(self); + +# ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */ + if ((val >= -1.0) && (val <= 1.0)) +# endif + { + __threadErrno = 0; + rslt = LONG_acosh(val); +# ifdef LONG_isnan + if (! LONG_isnan(rslt)) +# endif + { + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } + } + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#arcCosh + arguments:#() + errorString:'bad receiver in arcCosh' + + " + -10 asLongFloat arcCosh + 1 asLongFloat arcCosh + 0.5 asLongFloat arcCosh + " +! + +arcSin + "return the arcsine of myself (I am interpreted as radians). + Raises an exception, if the receiver is not in -1..1" + +%{ /* NOCONTEXT */ +#if defined(LONG_asin) + + LONGFLOAT val, rslt; + OBJ newFloat; + + val = __longFloatVal(self); + +# ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */ + if ((val >= -1.0) && (val <= 1.0)) +# endif + { + __threadErrno = 0; + rslt = LONG_asin(val); +# ifdef LONG_isnan + if (! LONG_isnan(rslt)) +# endif + { + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } + } + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#arcSin + arguments:#() + errorString:'bad receiver in arcSin' + + " + -10 asLongFloat arcSin + 1 asLongFloat arcSin + 0.5 asLongFloat arcSin + " +! + +arcSinh + "return the hyperbolic arcsine of myself (I am interpreted as radians). + Raises an exception, if the receiver is not in -1..1" + +%{ /* NOCONTEXT */ +#if defined(LONG_asinh) + + LONGFLOAT val, rslt; + OBJ newFloat; + + val = __longFloatVal(self); + +# ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */ + if ((val >= -1.0) && (val <= 1.0)) +# endif + { + __threadErrno = 0; + rslt = LONG_asinh(val); +# ifdef LONG_isnan + if (! LONG_isnan(rslt)) +# endif + { + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } + } + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#arcSinh + arguments:#() + errorString:'bad receiver in arcSinh' + + " + -10 asLongFloat arcSinh + 1 asLongFloat arcSinh + 0.5 asLongFloat arcSinh + " +! + +arcTan + "return the arctangent of myself as radians" + +%{ /* NOCONTEXT */ +#if defined(LONG_atan) + + LONGFLOAT rslt; + OBJ newFloat; + + __threadErrno = 0; + rslt = LONG_atan(__longFloatVal(self)); +# ifdef LONG_isnan + if (! LONG_isnan(rslt)) +# endif + { + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#arcTan + arguments:#() + errorString:'bad receiver in arcTan' +! + +arcTanh + "return the hyperbolic arctangent of myself as radians" + +%{ /* NOCONTEXT */ +#if defined(LONG_atanh) + + LONGFLOAT rslt; + OBJ newFloat; + + __threadErrno = 0; + rslt = LONG_atanh(__longFloatVal(self)); +# ifdef LONG_isnan + if (! LONG_isnan(rslt)) +# endif + { + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#arcTanh + arguments:#() + errorString:'bad receiver in arcTanh' +! + +cos + "return the cosine of myself interpreted as radians" + +%{ /* NOCONTEXT */ +#if defined(LONG_cos) + + LONGFLOAT rslt; + OBJ newFloat; + + __threadErrno = 0; + rslt = LONG_cos(__longFloatVal(self)); +# ifdef LONG_isnan + if (! LONG_isnan(rslt)) +# endif + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#cos + arguments:#() + errorString:'bad receiver in cos' +! + +cosh + "return the hyperbolic cosine of myself interpreted as radians" + +%{ /* NOCONTEXT */ +#if defined(LONG_cosh) + + LONGFLOAT rslt; + OBJ newFloat; + + __threadErrno = 0; + rslt = LONG_cosh(__longFloatVal(self)); +# ifdef LONG_isnan + if (! LONG_isnan(rslt)) +# endif + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#cosh + arguments:#() + errorString:'bad receiver in cosh' +! + +sin + "return the sine of myself interpreted as radians" + +%{ /* NOCONTEXT */ +#if defined(LONG_sin) + + LONGFLOAT rslt; + OBJ newFloat; + + __threadErrno = 0; + rslt = LONG_sin(__longFloatVal(self)); +# ifdef LINUX /* and maybe others */ + if (! isnan(rslt)) +# endif + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#sin + arguments:#() + errorString:'bad receiver in sin' +! + +sinh + "return the hyperbolic sine of myself interpreted as radians" + +%{ /* NOCONTEXT */ +#if defined(LONG_sinh) + + LONGFLOAT rslt; + OBJ newFloat; + + __threadErrno = 0; + rslt = LONG_sinh(__longFloatVal(self)); +# ifdef LINUX /* and maybe others */ + if (! isnan(rslt)) +# endif + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#sinh + arguments:#() + errorString:'bad receiver in sinh' +! + +tan + "return the tangens of myself interpreted as radians" + +%{ /* NOCONTEXT */ +#if defined(LONG_tan) + + LONGFLOAT rslt; + OBJ newFloat; + + __threadErrno = 0; + rslt = LONG_tan(__longFloatVal(self)); +# ifdef LINUX /* and maybe others */ + if (! isnan(rslt)) +# endif + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#tan + arguments:#() + errorString:'bad receiver in tan' +! + +tanh + "return the hyperbolic tangens of myself interpreted as radians" + +%{ /* NOCONTEXT */ +#if defined(LONG_tanh) + + LONGFLOAT rslt; + OBJ newFloat; + + __threadErrno = 0; + rslt = LONG_tanh(__longFloatVal(self)); +# ifdef LINUX /* and maybe others */ + if (! isnan(rslt)) +# endif + if (__threadErrno == 0) { + __qMKLFLOAT(newFloat, rslt); + RETURN ( newFloat ); + } +#endif +%}. + ^ self class + raise:#domainErrorSignal + receiver:self + selector:#tanh + arguments:#() + errorString:'bad receiver in tanh' +! ! + !LongFloat methodsFor:'truncation & rounding'! ceiling @@ -2032,5 +2034,5 @@ !LongFloat class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/LongFloat.st,v 1.28 2003-06-17 08:57:50 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/LongFloat.st,v 1.29 2003-06-17 09:12:22 cg Exp $' ! !