--- a/ArithmeticValue.st Tue Jun 17 11:10:25 2003 +0200
+++ b/ArithmeticValue.st Tue Jun 17 11:12:22 2003 +0200
@@ -872,10 +872,10 @@
raisedToInteger:exp
"return the receiver raised to exp"
- |result e t
- |
+ |result e t|
- "use the addition chaining algorithm"
+ "use the addition chaining algorithm,
+ which is much faster for big exp-arguments"
result := 1.
t := self.
@@ -1166,7 +1166,7 @@
!ArithmeticValue class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ArithmeticValue.st,v 1.49 2003-06-17 09:10:25 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ArithmeticValue.st,v 1.50 2003-06-17 09:11:17 cg Exp $'
! !
ArithmeticValue initialize!
--- a/Float.st Tue Jun 17 11:10:25 2003 +0200
+++ b/Float.st Tue Jun 17 11:12:22 2003 +0200
@@ -1117,284 +1117,6 @@
!Float 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 */
-
- double val, rslt;
- OBJ newFloat;
-
- val = __floatVal(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 = acos(val);
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- {
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
- }
- }
-%}.
- ^ self class
- raise:#domainErrorSignal
- receiver:self
- selector:#arcCos
- arguments:#()
- errorString:'bad receiver in arcCos'
-
- "
- -10 arcCos
- 1 arcCos
- "
-
- "Modified: / 16.11.2001 / 14:14:13 / cg"
-!
-
-arcCosh
- "return the hyperbolic arccosine of myself (I am interpreted as radians).
- Raises an exception, if the receiver is not in -1..1"
-
-%{ /* NOCONTEXT */
-
- double val, rslt;
- OBJ newFloat;
-
- val = __floatVal(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 = acosh(val);
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- {
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
- }
- }
-%}.
- ^ self class
- raise:#domainErrorSignal
- receiver:self
- selector:#arcCosh
- arguments:#()
- errorString:'bad receiver in arcCosh'
-
- "
- -10.0 arcCosh
- 1.0 arcCosh
- "
-
- "Modified: / 16.11.2001 / 14:14:13 / cg"
-!
-
-arcSin
- "return the arcsine of myself (I am interpreted as radians).
- Raises an exception, if the receiver is not in -1..1"
-
-%{ /* NOCONTEXT */
-
- double val, rslt;
- OBJ newFloat;
-
- val = __floatVal(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 = asin(val);
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- {
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
- }
- }
-%}.
- ^ self class
- raise:#domainErrorSignal
- receiver:self
- selector:#arcSin
- arguments:#()
- errorString:'bad receiver in arcSin'
-
- "
- -10 arcSin
- 1 arcSin
- "
-
- "Modified: / 16.11.2001 / 14:14:18 / cg"
-!
-
-arcSinh
- "return the hyperbolic arcsine of myself (I am interpreted as radians).
- Raises an exception, if the receiver is not in -1..1"
-
-%{ /* NOCONTEXT */
-
- double val, rslt;
- OBJ newFloat;
-
- val = __floatVal(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 = asinh(val);
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- {
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
- }
- }
-%}.
- ^ self class
- raise:#domainErrorSignal
- receiver:self
- selector:#arcSinh
- arguments:#()
- errorString:'bad receiver in arcSinh'
-
- "
- -10.0 arcSinh
- 1.0 arcSinh
- "
-!
-
-arcTan
- "return the arctangent of myself as radians"
-
-%{ /* NOCONTEXT */
-
- double rslt;
- OBJ newFloat;
-
- __threadErrno = 0;
- rslt = atan(__floatVal(self));
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
-%}.
- ^ self class
- raise:#domainErrorSignal
- receiver:self
- selector:#arcTan
- arguments:#()
- errorString:'bad receiver in arcTan'
-
- "Modified: / 16.11.2001 / 14:14:22 / cg"
-!
-
-arcTanh
- "return the hyperbolic arctangent of myself as radians"
-
-%{ /* NOCONTEXT */
-
- double rslt;
- OBJ newFloat;
-
- __threadErrno = 0;
- rslt = atanh(__floatVal(self));
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
-%}.
- ^ self class
- raise:#domainErrorSignal
- receiver:self
- selector:#arcTanh
- arguments:#()
- errorString:'bad receiver in arcTanh'
-!
-
-cos
- "return the cosine of myself interpreted as radians"
-
-%{ /* NOCONTEXT */
-
- double rslt;
- OBJ newFloat;
-
- __threadErrno = 0;
- rslt = cos(__floatVal(self));
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
-%}.
- ^ self class
- raise:#domainErrorSignal
- receiver:self
- selector:#cos
- arguments:#()
- errorString:'bad receiver in cos'
-
- "Modified: / 16.11.2001 / 14:14:26 / cg"
-!
-
-cosh
- "return the hyperbolic cosine of myself interpreted as radians"
-
-%{ /* NOCONTEXT */
-
- double rslt;
- OBJ newFloat;
-
- __threadErrno = 0;
- rslt = cosh(__floatVal(self));
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
-%}.
- ^ self class
- raise:#domainErrorSignal
- receiver:self
- selector:#cosh
- arguments:#()
- errorString:'bad receiver in cosh'
-!
-
exp
"return e raised to the power of the receiver"
@@ -1540,60 +1262,6 @@
"Modified: / 16.11.2001 / 14:16:51 / cg"
!
-sin
- "return the sine of myself interpreted as radians"
-
-%{ /* NOCONTEXT */
-
- double rslt;
- OBJ newFloat;
-
- __threadErrno = 0;
- rslt = sin(__floatVal(self));
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
-%}.
- ^ self class
- raise:#domainErrorSignal
- receiver:self
- selector:#sin
- arguments:#()
- errorString:'bad receiver in sin'
-
- "Modified: / 16.11.2001 / 14:14:37 / cg"
-!
-
-sinh
- "return the hyperbolic sine of myself interpreted as radians"
-
-%{ /* NOCONTEXT */
-
- double rslt;
- OBJ newFloat;
-
- __threadErrno = 0;
- rslt = sinh(__floatVal(self));
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
-%}.
- ^ 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."
@@ -1635,60 +1303,6 @@
"
"Modified: / 16.11.2001 / 14:14:43 / cg"
-!
-
-tan
- "return the tangent of myself interpreted as radians"
-
-%{ /* NOCONTEXT */
-
- double rslt;
- OBJ newFloat;
-
- __threadErrno = 0;
- rslt = tan(__floatVal(self));
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
-%}.
- ^ self class
- raise:#domainErrorSignal
- receiver:self
- selector:#tan
- arguments:#()
- errorString:'bad receiver in tan'
-
- "Modified: / 16.11.2001 / 14:14:49 / cg"
-!
-
-tanh
- "return the hyperbolic tangens of myself interpreted as radians"
-
-%{ /* NOCONTEXT */
-
- double rslt;
- OBJ newFloat;
-
- __threadErrno = 0;
- rslt = tanh(__floatVal(self));
-#ifdef LINUX /* and maybe others */
- if (! isnan(rslt))
-#endif
- if (__threadErrno == 0) {
- __qMKFLOAT(newFloat, rslt);
- RETURN ( newFloat );
- }
-%}.
- ^ self class
- raise:#domainErrorSignal
- receiver:self
- selector:#tanh
- arguments:#()
- errorString:'bad receiver in tanh'
! !
!Float methodsFor:'printing & storing'!
@@ -2197,6 +1811,394 @@
! !
+!Float 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 */
+
+ double val, rslt;
+ OBJ newFloat;
+
+ val = __floatVal(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 = acos(val);
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ {
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+ }
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#arcCos
+ arguments:#()
+ errorString:'bad receiver in arcCos'
+
+ "
+ -10 arcCos
+ 1 arcCos
+ "
+
+ "Modified: / 16.11.2001 / 14:14:13 / cg"
+!
+
+arcCosh
+ "return the hyperbolic arccosine of myself (I am interpreted as radians).
+ Raises an exception, if the receiver is not in -1..1"
+
+%{ /* NOCONTEXT */
+
+ double val, rslt;
+ OBJ newFloat;
+
+ val = __floatVal(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 = acosh(val);
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ {
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+ }
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#arcCosh
+ arguments:#()
+ errorString:'bad receiver in arcCosh'
+
+ "
+ -10.0 arcCosh
+ 1.0 arcCosh
+ "
+
+ "Modified: / 16.11.2001 / 14:14:13 / cg"
+!
+
+arcSin
+ "return the arcsine of myself (I am interpreted as radians).
+ Raises an exception, if the receiver is not in -1..1"
+
+%{ /* NOCONTEXT */
+
+ double val, rslt;
+ OBJ newFloat;
+
+ val = __floatVal(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 = asin(val);
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ {
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+ }
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#arcSin
+ arguments:#()
+ errorString:'bad receiver in arcSin'
+
+ "
+ -10 arcSin
+ 1 arcSin
+ "
+
+ "Modified: / 16.11.2001 / 14:14:18 / cg"
+!
+
+arcSinh
+ "return the hyperbolic arcsine of myself (I am interpreted as radians).
+ Raises an exception, if the receiver is not in -1..1"
+
+%{ /* NOCONTEXT */
+
+ double val, rslt;
+ OBJ newFloat;
+
+ val = __floatVal(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 = asinh(val);
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ {
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+ }
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#arcSinh
+ arguments:#()
+ errorString:'bad receiver in arcSinh'
+
+ "
+ -10.0 arcSinh
+ 1.0 arcSinh
+ "
+!
+
+arcTan
+ "return the arctangent of myself as radians"
+
+%{ /* NOCONTEXT */
+
+ double rslt;
+ OBJ newFloat;
+
+ __threadErrno = 0;
+ rslt = atan(__floatVal(self));
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#arcTan
+ arguments:#()
+ errorString:'bad receiver in arcTan'
+
+ "Modified: / 16.11.2001 / 14:14:22 / cg"
+!
+
+arcTanh
+ "return the hyperbolic arctangent of myself as radians"
+
+%{ /* NOCONTEXT */
+
+ double rslt;
+ OBJ newFloat;
+
+ __threadErrno = 0;
+ rslt = atanh(__floatVal(self));
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#arcTanh
+ arguments:#()
+ errorString:'bad receiver in arcTanh'
+!
+
+cos
+ "return the cosine of myself interpreted as radians"
+
+%{ /* NOCONTEXT */
+
+ double rslt;
+ OBJ newFloat;
+
+ __threadErrno = 0;
+ rslt = cos(__floatVal(self));
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#cos
+ arguments:#()
+ errorString:'bad receiver in cos'
+
+ "Modified: / 16.11.2001 / 14:14:26 / cg"
+!
+
+cosh
+ "return the hyperbolic cosine of myself interpreted as radians"
+
+%{ /* NOCONTEXT */
+
+ double rslt;
+ OBJ newFloat;
+
+ __threadErrno = 0;
+ rslt = cosh(__floatVal(self));
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#cosh
+ arguments:#()
+ errorString:'bad receiver in cosh'
+!
+
+sin
+ "return the sine of myself interpreted as radians"
+
+%{ /* NOCONTEXT */
+
+ double rslt;
+ OBJ newFloat;
+
+ __threadErrno = 0;
+ rslt = sin(__floatVal(self));
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#sin
+ arguments:#()
+ errorString:'bad receiver in sin'
+
+ "Modified: / 16.11.2001 / 14:14:37 / cg"
+!
+
+sinh
+ "return the hyperbolic sine of myself interpreted as radians"
+
+%{ /* NOCONTEXT */
+
+ double rslt;
+ OBJ newFloat;
+
+ __threadErrno = 0;
+ rslt = sinh(__floatVal(self));
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#sinh
+ arguments:#()
+ errorString:'bad receiver in sinh'
+!
+
+tan
+ "return the tangent of myself interpreted as radians"
+
+%{ /* NOCONTEXT */
+
+ double rslt;
+ OBJ newFloat;
+
+ __threadErrno = 0;
+ rslt = tan(__floatVal(self));
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#tan
+ arguments:#()
+ errorString:'bad receiver in tan'
+
+ "Modified: / 16.11.2001 / 14:14:49 / cg"
+!
+
+tanh
+ "return the hyperbolic tangens of myself interpreted as radians"
+
+%{ /* NOCONTEXT */
+
+ double rslt;
+ OBJ newFloat;
+
+ __threadErrno = 0;
+ rslt = tanh(__floatVal(self));
+#ifdef LINUX /* and maybe others */
+ if (! isnan(rslt))
+#endif
+ if (__threadErrno == 0) {
+ __qMKFLOAT(newFloat, rslt);
+ RETURN ( newFloat );
+ }
+%}.
+ ^ self class
+ raise:#domainErrorSignal
+ receiver:self
+ selector:#tanh
+ arguments:#()
+ errorString:'bad receiver in tanh'
+! !
+
!Float methodsFor:'truncation & rounding'!
ceiling
@@ -2461,7 +2463,7 @@
!Float class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.136 2003-06-17 08:47:13 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.137 2003-06-17 09:11:52 cg Exp $'
! !
Float initialize!
--- 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 $'
! !