LongFloat.st
changeset 7385 852e84340d2b
parent 7383 0219aa6bd824
child 7389 4fd487ca919a
equal deleted inserted replaced
7384:ae6b11a3b4d5 7385:852e84340d2b
   900     ^ super ~= aNumber
   900     ^ super ~= aNumber
   901 ! !
   901 ! !
   902 
   902 
   903 !LongFloat methodsFor:'mathematical functions'!
   903 !LongFloat methodsFor:'mathematical functions'!
   904 
   904 
   905 arcCos
   905 exp
   906     "return the arccosine of myself (I am interpreted as radians).
   906     "return e raised to the power of the receiver"
   907      Raises an exception, if the receiver is not in -1..1"
   907 
   908 
   908 %{  /* NOCONTEXT */
   909 %{  /* NOCONTEXT */
   909 #if defined(LONG_exp)
   910 #if defined(LONG_acos)
   910 
       
   911     LONGFLOAT rslt;
       
   912     OBJ newFloat;
       
   913 
       
   914     __threadErrno = 0;
       
   915     rslt = LONG_exp(__longFloatVal(self));
       
   916 # ifdef LONG_isnan
       
   917     if (! LONG_isnan(rslt))
       
   918 # endif
       
   919     if (__threadErrno == 0) {
       
   920 	__qMKLFLOAT(newFloat, rslt);
       
   921 	RETURN ( newFloat );
       
   922     }
       
   923 #endif
       
   924 %}.
       
   925     ^ self class
       
   926 	raise:#domainErrorSignal
       
   927 	receiver:self
       
   928 	selector:#exp
       
   929 	arguments:#()
       
   930 	errorString:'bad receiver in exp'
       
   931 !
       
   932 
       
   933 ln
       
   934     "return the natural logarithm of myself.
       
   935      Raises an exception, if the receiver is less or equal to zero."
       
   936 
       
   937 %{  /* NOCONTEXT */
       
   938 #if defined(LONG_log)
   911 
   939 
   912     LONGFLOAT val, rslt;
   940     LONGFLOAT val, rslt;
   913     OBJ newFloat;
   941     OBJ newFloat;
   914 
   942 
   915     val = __longFloatVal(self);
   943     val = __longFloatVal(self);
   916 
   944 
   917 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
   945 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
   918     if ((val >= -1.0) && (val <= 1.0))
   946     if (val > 0.0)
   919 # endif
   947 # endif
   920     {
   948     {
   921 	__threadErrno = 0;
   949 	__threadErrno = 0;
   922 	rslt = LONG_acos(val);
   950 	rslt = LONG_log(val);
   923 # ifdef LONG_isnan
   951 # ifdef LONG_isnan
   924 	if (! LONG_isnan(rslt))
   952         if (! LONG_isnan(rslt))
   925 # endif
   953 # endif
   926 	{
   954 	{
   927 	    if (__threadErrno == 0) {
   955 	    if (__threadErrno == 0) {
   928 		__qMKLFLOAT(newFloat, rslt);
   956 		__qMKLFLOAT(newFloat, rslt);
   929 		RETURN ( newFloat );
   957 		RETURN ( newFloat );
   930 	    }
   958 	    }
   931 	}
   959 	}
   932     }
   960     }
   933 #endif
   961 #endif
   934 %}.
   962 %}.
       
   963     "
       
   964      an invalid value for logarithm
       
   965     "
   935     ^ self class
   966     ^ self class
   936 	raise:#domainErrorSignal
   967 	raise:#domainErrorSignal
   937 	receiver:self
   968 	receiver:self
   938 	selector:#arcCos
   969 	selector:#ln
   939 	arguments:#()
   970 	arguments:#()
   940 	errorString:'bad receiver in arcCos'
   971 	errorString:'bad receiver in ln'
   941 
   972 !
   942     "
   973 
   943      -10 asLongFloat arcCos
   974 log10
   944      1 asLongFloat arcCos  
   975     "return the base10 logarithm of myself.
   945      0.5 asLongFloat arcCos  
   976      Raises an exception, if the receiver is less or equal to zero."
   946     "
   977 
   947 !
   978 %{  /* NOCONTEXT */
   948 
   979 #if defined(LONG_log10)
   949 arcCosh
   980 
   950     "return the hyperbolic arccosine of myself (I am interpreted as radians).
       
   951      Raises an exception, if the receiver is not in -1..1"
       
   952  
       
   953 %{  /* NOCONTEXT */
       
   954 #if defined(LONG_acosh)
       
   955  
       
   956     LONGFLOAT val, rslt;
   981     LONGFLOAT val, rslt;
   957     OBJ newFloat;
   982     OBJ newFloat;
   958  
   983 
   959     val = __longFloatVal(self);
   984     val = __longFloatVal(self);
   960  
   985 
   961 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
   986 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
   962     if ((val >= -1.0) && (val <= 1.0))
   987     if (val > 0.0)
   963 # endif
   988 # endif
   964     {
   989     {
   965         __threadErrno = 0;
   990         __threadErrno = 0;
   966         rslt = LONG_acosh(val);
   991         rslt = LONG_log10(val);
   967 # ifdef LONG_isnan
   992 # ifdef LONG_isnan
   968         if (! LONG_isnan(rslt))
   993         if (! LONG_isnan(rslt))
   969 # endif
   994 # endif
   970         {
   995         {
   971             if (__threadErrno == 0) {
   996             if (__threadErrno == 0) {
   974             }
   999             }
   975         }
  1000         }
   976     }
  1001     }
   977 #endif
  1002 #endif
   978 %}.
  1003 %}.
   979     ^ self class
       
   980         raise:#domainErrorSignal
       
   981         receiver:self
       
   982         selector:#arcCosh
       
   983         arguments:#()
       
   984         errorString:'bad receiver in arcCosh'
       
   985  
       
   986     "
       
   987      -10 asLongFloat arcCosh
       
   988      1 asLongFloat arcCosh
       
   989      0.5 asLongFloat arcCosh
       
   990     "
       
   991 !
       
   992 
       
   993 arcSin
       
   994     "return the arcsine of myself (I am interpreted as radians).
       
   995      Raises an exception, if the receiver is not in -1..1"
       
   996 
       
   997 %{  /* NOCONTEXT */
       
   998 #if defined(LONG_asin)
       
   999 
       
  1000     LONGFLOAT val, rslt;
       
  1001     OBJ newFloat;
       
  1002 
       
  1003     val = __longFloatVal(self);
       
  1004 
       
  1005 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
       
  1006     if ((val >= -1.0) && (val <= 1.0))
       
  1007 # endif
       
  1008     {
       
  1009 	__threadErrno = 0;
       
  1010 	rslt = LONG_asin(val);
       
  1011 # ifdef LONG_isnan
       
  1012 	if (! LONG_isnan(rslt))
       
  1013 # endif
       
  1014 	{
       
  1015 	    if (__threadErrno == 0) {
       
  1016 		__qMKLFLOAT(newFloat, rslt);
       
  1017 		RETURN ( newFloat );
       
  1018 	    }
       
  1019 	}
       
  1020     }
       
  1021 #endif
       
  1022 %}.
       
  1023     ^ self class
       
  1024 	raise:#domainErrorSignal
       
  1025 	receiver:self
       
  1026 	selector:#arcSin
       
  1027 	arguments:#()
       
  1028 	errorString:'bad receiver in arcSin'
       
  1029 
       
  1030     "
       
  1031      -10 asLongFloat arcSin
       
  1032      1 asLongFloat arcSin  
       
  1033      0.5 asLongFloat arcSin  
       
  1034     "
       
  1035 !
       
  1036 
       
  1037 arcSinh
       
  1038     "return the hyperbolic arcsine of myself (I am interpreted as radians).
       
  1039      Raises an exception, if the receiver is not in -1..1"
       
  1040  
       
  1041 %{  /* NOCONTEXT */
       
  1042 #if defined(LONG_asinh)
       
  1043  
       
  1044     LONGFLOAT val, rslt;
       
  1045     OBJ newFloat;
       
  1046  
       
  1047     val = __longFloatVal(self);
       
  1048  
       
  1049 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
       
  1050     if ((val >= -1.0) && (val <= 1.0))
       
  1051 # endif
       
  1052     {
       
  1053         __threadErrno = 0;
       
  1054         rslt = LONG_asinh(val);
       
  1055 # ifdef LONG_isnan
       
  1056         if (! LONG_isnan(rslt))
       
  1057 # endif
       
  1058         {
       
  1059             if (__threadErrno == 0) {
       
  1060                 __qMKLFLOAT(newFloat, rslt);
       
  1061                 RETURN ( newFloat );
       
  1062             }
       
  1063         }
       
  1064     }
       
  1065 #endif
       
  1066 %}.
       
  1067     ^ self class
       
  1068         raise:#domainErrorSignal
       
  1069         receiver:self
       
  1070         selector:#arcSinh
       
  1071         arguments:#()
       
  1072         errorString:'bad receiver in arcSinh'
       
  1073  
       
  1074     "
       
  1075      -10 asLongFloat arcSinh
       
  1076      1 asLongFloat arcSinh
       
  1077      0.5 asLongFloat arcSinh
       
  1078     "
       
  1079 !
       
  1080 
       
  1081 arcTan
       
  1082     "return the arctangent of myself as radians"
       
  1083 
       
  1084 %{  /* NOCONTEXT */
       
  1085 #if defined(LONG_atan)
       
  1086 
       
  1087     LONGFLOAT rslt;
       
  1088     OBJ newFloat;
       
  1089 
       
  1090     __threadErrno = 0;
       
  1091     rslt = LONG_atan(__longFloatVal(self));
       
  1092 # ifdef LONG_isnan
       
  1093     if (! LONG_isnan(rslt))
       
  1094 # endif
       
  1095     {
       
  1096         if (__threadErrno == 0) {
       
  1097 	    __qMKLFLOAT(newFloat, rslt);
       
  1098 	    RETURN ( newFloat );
       
  1099 	}
       
  1100     }
       
  1101 #endif
       
  1102 %}.
       
  1103     ^ self class
       
  1104 	raise:#domainErrorSignal
       
  1105 	receiver:self
       
  1106 	selector:#arcTan
       
  1107 	arguments:#()
       
  1108 	errorString:'bad receiver in arcTan'
       
  1109 !
       
  1110 
       
  1111 arcTanh
       
  1112     "return the hyperbolic arctangent of myself as radians"
       
  1113  
       
  1114 %{  /* NOCONTEXT */
       
  1115 #if defined(LONG_atanh)
       
  1116  
       
  1117     LONGFLOAT rslt;
       
  1118     OBJ newFloat;
       
  1119  
       
  1120     __threadErrno = 0;
       
  1121     rslt = LONG_atanh(__longFloatVal(self));
       
  1122 # ifdef LONG_isnan
       
  1123     if (! LONG_isnan(rslt))
       
  1124 # endif
       
  1125     {
       
  1126         if (__threadErrno == 0) {
       
  1127             __qMKLFLOAT(newFloat, rslt);
       
  1128             RETURN ( newFloat );
       
  1129         }
       
  1130     }
       
  1131 #endif
       
  1132 %}.
       
  1133     ^ self class
       
  1134         raise:#domainErrorSignal
       
  1135         receiver:self
       
  1136         selector:#arcTanh
       
  1137         arguments:#()
       
  1138         errorString:'bad receiver in arcTanh'
       
  1139 !
       
  1140 
       
  1141 cos
       
  1142     "return the cosine of myself interpreted as radians"
       
  1143 
       
  1144 %{  /* NOCONTEXT */
       
  1145 #if defined(LONG_cos)
       
  1146 
       
  1147     LONGFLOAT rslt;
       
  1148     OBJ newFloat;
       
  1149 
       
  1150     __threadErrno = 0;
       
  1151     rslt = LONG_cos(__longFloatVal(self));
       
  1152 # ifdef LONG_isnan
       
  1153     if (! LONG_isnan(rslt))
       
  1154 # endif
       
  1155     if (__threadErrno == 0) {
       
  1156 	__qMKLFLOAT(newFloat, rslt);
       
  1157 	RETURN ( newFloat );
       
  1158     }
       
  1159 #endif
       
  1160 %}.
       
  1161     ^ self class
       
  1162 	raise:#domainErrorSignal
       
  1163 	receiver:self
       
  1164 	selector:#cos
       
  1165 	arguments:#()
       
  1166 	errorString:'bad receiver in cos'
       
  1167 !
       
  1168 
       
  1169 cosh
       
  1170     "return the hyperbolic cosine of myself interpreted as radians"
       
  1171  
       
  1172 %{  /* NOCONTEXT */
       
  1173 #if defined(LONG_cosh)
       
  1174  
       
  1175     LONGFLOAT rslt;
       
  1176     OBJ newFloat;
       
  1177  
       
  1178     __threadErrno = 0;
       
  1179     rslt = LONG_cosh(__longFloatVal(self));
       
  1180 # ifdef LONG_isnan
       
  1181     if (! LONG_isnan(rslt))
       
  1182 # endif
       
  1183     if (__threadErrno == 0) {
       
  1184         __qMKLFLOAT(newFloat, rslt);
       
  1185         RETURN ( newFloat );
       
  1186     }
       
  1187 #endif
       
  1188 %}.
       
  1189     ^ self class
       
  1190         raise:#domainErrorSignal
       
  1191         receiver:self
       
  1192         selector:#cosh
       
  1193         arguments:#()
       
  1194         errorString:'bad receiver in cosh'
       
  1195 !
       
  1196 
       
  1197 exp
       
  1198     "return e raised to the power of the receiver"
       
  1199 
       
  1200 %{  /* NOCONTEXT */
       
  1201 #if defined(LONG_exp)
       
  1202 
       
  1203     LONGFLOAT rslt;
       
  1204     OBJ newFloat;
       
  1205 
       
  1206     __threadErrno = 0;
       
  1207     rslt = LONG_exp(__longFloatVal(self));
       
  1208 # ifdef LONG_isnan
       
  1209     if (! LONG_isnan(rslt))
       
  1210 # endif
       
  1211     if (__threadErrno == 0) {
       
  1212 	__qMKLFLOAT(newFloat, rslt);
       
  1213 	RETURN ( newFloat );
       
  1214     }
       
  1215 #endif
       
  1216 %}.
       
  1217     ^ self class
       
  1218 	raise:#domainErrorSignal
       
  1219 	receiver:self
       
  1220 	selector:#exp
       
  1221 	arguments:#()
       
  1222 	errorString:'bad receiver in exp'
       
  1223 !
       
  1224 
       
  1225 ln
       
  1226     "return the natural logarithm of myself.
       
  1227      Raises an exception, if the receiver is less or equal to zero."
       
  1228 
       
  1229 %{  /* NOCONTEXT */
       
  1230 #if defined(LONG_log)
       
  1231 
       
  1232     LONGFLOAT val, rslt;
       
  1233     OBJ newFloat;
       
  1234 
       
  1235     val = __longFloatVal(self);
       
  1236 
       
  1237 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
       
  1238     if (val > 0.0)
       
  1239 # endif
       
  1240     {
       
  1241 	__threadErrno = 0;
       
  1242 	rslt = LONG_log(val);
       
  1243 # ifdef LONG_isnan
       
  1244         if (! LONG_isnan(rslt))
       
  1245 # endif
       
  1246 	{
       
  1247 	    if (__threadErrno == 0) {
       
  1248 		__qMKLFLOAT(newFloat, rslt);
       
  1249 		RETURN ( newFloat );
       
  1250 	    }
       
  1251 	}
       
  1252     }
       
  1253 #endif
       
  1254 %}.
       
  1255     "
       
  1256      an invalid value for logarithm
       
  1257     "
       
  1258     ^ self class
       
  1259 	raise:#domainErrorSignal
       
  1260 	receiver:self
       
  1261 	selector:#ln
       
  1262 	arguments:#()
       
  1263 	errorString:'bad receiver in ln'
       
  1264 !
       
  1265 
       
  1266 log10
       
  1267     "return the base10 logarithm of myself.
       
  1268      Raises an exception, if the receiver is less or equal to zero."
       
  1269 
       
  1270 %{  /* NOCONTEXT */
       
  1271 #if defined(LONG_log10)
       
  1272 
       
  1273     LONGFLOAT val, rslt;
       
  1274     OBJ newFloat;
       
  1275 
       
  1276     val = __longFloatVal(self);
       
  1277 
       
  1278 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
       
  1279     if (val > 0.0)
       
  1280 # endif
       
  1281     {
       
  1282         __threadErrno = 0;
       
  1283         rslt = LONG_log10(val);
       
  1284 # ifdef LONG_isnan
       
  1285         if (! LONG_isnan(rslt))
       
  1286 # endif
       
  1287         {
       
  1288             if (__threadErrno == 0) {
       
  1289                 __qMKLFLOAT(newFloat, rslt);
       
  1290                 RETURN ( newFloat );
       
  1291             }
       
  1292         }
       
  1293     }
       
  1294 #endif
       
  1295 %}.
       
  1296     "
  1004     "
  1297      an invalid value for logarithm
  1005      an invalid value for logarithm
  1298     "
  1006     "
  1299     ^ self class
  1007     ^ self class
  1300         raise:#domainErrorSignal
  1008         raise:#domainErrorSignal
  1341 	errorString:'bad receiver/arg in raisedTo:'
  1049 	errorString:'bad receiver/arg in raisedTo:'
  1342 
  1050 
  1343     "Modified: / 16.11.2001 / 14:16:51 / cg"
  1051     "Modified: / 16.11.2001 / 14:16:51 / cg"
  1344 !
  1052 !
  1345 
  1053 
  1346 sin
       
  1347     "return the sine of myself interpreted as radians"
       
  1348 
       
  1349 %{  /* NOCONTEXT */
       
  1350 #if defined(LONG_sin)
       
  1351 
       
  1352     LONGFLOAT rslt;
       
  1353     OBJ newFloat;
       
  1354 
       
  1355     __threadErrno = 0;
       
  1356     rslt = LONG_sin(__longFloatVal(self));
       
  1357 # ifdef LINUX /* and maybe others */
       
  1358     if (! isnan(rslt))
       
  1359 # endif
       
  1360     if (__threadErrno == 0) {
       
  1361 	__qMKLFLOAT(newFloat, rslt);
       
  1362 	RETURN ( newFloat );
       
  1363     }
       
  1364 #endif
       
  1365 %}.
       
  1366     ^ self class
       
  1367 	raise:#domainErrorSignal
       
  1368 	receiver:self
       
  1369 	selector:#sin
       
  1370 	arguments:#()
       
  1371 	errorString:'bad receiver in sin'
       
  1372 !
       
  1373 
       
  1374 sinh
       
  1375     "return the hyperbolic sine of myself interpreted as radians"
       
  1376  
       
  1377 %{  /* NOCONTEXT */
       
  1378 #if defined(LONG_sinh)
       
  1379  
       
  1380     LONGFLOAT rslt;
       
  1381     OBJ newFloat;
       
  1382  
       
  1383     __threadErrno = 0;
       
  1384     rslt = LONG_sinh(__longFloatVal(self));
       
  1385 # ifdef LINUX /* and maybe others */
       
  1386     if (! isnan(rslt))
       
  1387 # endif
       
  1388     if (__threadErrno == 0) {
       
  1389         __qMKLFLOAT(newFloat, rslt);
       
  1390         RETURN ( newFloat );
       
  1391     }
       
  1392 #endif
       
  1393 %}.
       
  1394     ^ self class
       
  1395         raise:#domainErrorSignal
       
  1396         receiver:self
       
  1397         selector:#sinh
       
  1398         arguments:#()
       
  1399         errorString:'bad receiver in sinh'
       
  1400 !
       
  1401 
       
  1402 sqrt
  1054 sqrt
  1403     "return the square root of myself.
  1055     "return the square root of myself.
  1404      Raises an exception, if the receiver is less than zero."
  1056      Raises an exception, if the receiver is less than zero."
  1405 
  1057 
  1406 %{  /* NOCONTEXT */
  1058 %{  /* NOCONTEXT */
  1440      10 asLongFloat sqrt
  1092      10 asLongFloat sqrt
  1441      -10 asLongFloat sqrt
  1093      -10 asLongFloat sqrt
  1442     "
  1094     "
  1443 
  1095 
  1444     "Modified: / 16.11.2001 / 14:14:43 / cg"
  1096     "Modified: / 16.11.2001 / 14:14:43 / cg"
  1445 !
       
  1446 
       
  1447 tan
       
  1448     "return the tangens of myself interpreted as radians"
       
  1449 
       
  1450 %{  /* NOCONTEXT */
       
  1451 #if defined(LONG_tan)
       
  1452 
       
  1453     LONGFLOAT rslt;
       
  1454     OBJ newFloat;
       
  1455 
       
  1456     __threadErrno = 0;
       
  1457     rslt = LONG_tan(__longFloatVal(self));
       
  1458 # ifdef LINUX /* and maybe others */
       
  1459     if (! isnan(rslt))
       
  1460 # endif
       
  1461     if (__threadErrno == 0) {
       
  1462 	__qMKLFLOAT(newFloat, rslt);
       
  1463 	RETURN ( newFloat );
       
  1464     }
       
  1465 #endif
       
  1466 %}.
       
  1467     ^ self class
       
  1468 	raise:#domainErrorSignal
       
  1469 	receiver:self
       
  1470 	selector:#tan
       
  1471 	arguments:#()
       
  1472 	errorString:'bad receiver in tan'
       
  1473 !
       
  1474 
       
  1475 tanh
       
  1476     "return the hyperbolic tangens of myself interpreted as radians"
       
  1477  
       
  1478 %{  /* NOCONTEXT */
       
  1479 #if defined(LONG_tanh)
       
  1480  
       
  1481     LONGFLOAT rslt;
       
  1482     OBJ newFloat;
       
  1483  
       
  1484     __threadErrno = 0;
       
  1485     rslt = LONG_tanh(__longFloatVal(self));
       
  1486 # ifdef LINUX /* and maybe others */
       
  1487     if (! isnan(rslt))
       
  1488 # endif
       
  1489     if (__threadErrno == 0) {
       
  1490         __qMKLFLOAT(newFloat, rslt);
       
  1491         RETURN ( newFloat );
       
  1492     }
       
  1493 #endif
       
  1494 %}.
       
  1495     ^ self class
       
  1496         raise:#domainErrorSignal
       
  1497         receiver:self
       
  1498         selector:#tanh
       
  1499         arguments:#()
       
  1500         errorString:'bad receiver in tanh'
       
  1501 ! !
  1097 ! !
  1502 
  1098 
  1503 !LongFloat methodsFor:'printing & storing'!
  1099 !LongFloat methodsFor:'printing & storing'!
  1504 
  1100 
  1505 printString
  1101 printString
  1791 
  1387 
  1792     RETURN ( (__longFloatVal(self) > 0.0) ? true : false );
  1388     RETURN ( (__longFloatVal(self) > 0.0) ? true : false );
  1793 %}
  1389 %}
  1794 ! !
  1390 ! !
  1795 
  1391 
       
  1392 !LongFloat methodsFor:'trigonometric'!
       
  1393 
       
  1394 arcCos
       
  1395     "return the arccosine of myself (I am interpreted as radians).
       
  1396      Raises an exception, if the receiver is not in -1..1"
       
  1397 
       
  1398 %{  /* NOCONTEXT */
       
  1399 #if defined(LONG_acos)
       
  1400 
       
  1401     LONGFLOAT val, rslt;
       
  1402     OBJ newFloat;
       
  1403 
       
  1404     val = __longFloatVal(self);
       
  1405 
       
  1406 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
       
  1407     if ((val >= -1.0) && (val <= 1.0))
       
  1408 # endif
       
  1409     {
       
  1410 	__threadErrno = 0;
       
  1411 	rslt = LONG_acos(val);
       
  1412 # ifdef LONG_isnan
       
  1413 	if (! LONG_isnan(rslt))
       
  1414 # endif
       
  1415 	{
       
  1416 	    if (__threadErrno == 0) {
       
  1417 		__qMKLFLOAT(newFloat, rslt);
       
  1418 		RETURN ( newFloat );
       
  1419 	    }
       
  1420 	}
       
  1421     }
       
  1422 #endif
       
  1423 %}.
       
  1424     ^ self class
       
  1425 	raise:#domainErrorSignal
       
  1426 	receiver:self
       
  1427 	selector:#arcCos
       
  1428 	arguments:#()
       
  1429 	errorString:'bad receiver in arcCos'
       
  1430 
       
  1431     "
       
  1432      -10 asLongFloat arcCos
       
  1433      1 asLongFloat arcCos  
       
  1434      0.5 asLongFloat arcCos  
       
  1435     "
       
  1436 !
       
  1437 
       
  1438 arcCosh
       
  1439     "return the hyperbolic arccosine of myself (I am interpreted as radians).
       
  1440      Raises an exception, if the receiver is not in -1..1"
       
  1441  
       
  1442 %{  /* NOCONTEXT */
       
  1443 #if defined(LONG_acosh)
       
  1444  
       
  1445     LONGFLOAT val, rslt;
       
  1446     OBJ newFloat;
       
  1447  
       
  1448     val = __longFloatVal(self);
       
  1449  
       
  1450 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
       
  1451     if ((val >= -1.0) && (val <= 1.0))
       
  1452 # endif
       
  1453     {
       
  1454         __threadErrno = 0;
       
  1455         rslt = LONG_acosh(val);
       
  1456 # ifdef LONG_isnan
       
  1457         if (! LONG_isnan(rslt))
       
  1458 # endif
       
  1459         {
       
  1460             if (__threadErrno == 0) {
       
  1461                 __qMKLFLOAT(newFloat, rslt);
       
  1462                 RETURN ( newFloat );
       
  1463             }
       
  1464         }
       
  1465     }
       
  1466 #endif
       
  1467 %}.
       
  1468     ^ self class
       
  1469         raise:#domainErrorSignal
       
  1470         receiver:self
       
  1471         selector:#arcCosh
       
  1472         arguments:#()
       
  1473         errorString:'bad receiver in arcCosh'
       
  1474  
       
  1475     "
       
  1476      -10 asLongFloat arcCosh
       
  1477      1 asLongFloat arcCosh
       
  1478      0.5 asLongFloat arcCosh
       
  1479     "
       
  1480 !
       
  1481 
       
  1482 arcSin
       
  1483     "return the arcsine of myself (I am interpreted as radians).
       
  1484      Raises an exception, if the receiver is not in -1..1"
       
  1485 
       
  1486 %{  /* NOCONTEXT */
       
  1487 #if defined(LONG_asin)
       
  1488 
       
  1489     LONGFLOAT val, rslt;
       
  1490     OBJ newFloat;
       
  1491 
       
  1492     val = __longFloatVal(self);
       
  1493 
       
  1494 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
       
  1495     if ((val >= -1.0) && (val <= 1.0))
       
  1496 # endif
       
  1497     {
       
  1498 	__threadErrno = 0;
       
  1499 	rslt = LONG_asin(val);
       
  1500 # ifdef LONG_isnan
       
  1501 	if (! LONG_isnan(rslt))
       
  1502 # endif
       
  1503 	{
       
  1504 	    if (__threadErrno == 0) {
       
  1505 		__qMKLFLOAT(newFloat, rslt);
       
  1506 		RETURN ( newFloat );
       
  1507 	    }
       
  1508 	}
       
  1509     }
       
  1510 #endif
       
  1511 %}.
       
  1512     ^ self class
       
  1513 	raise:#domainErrorSignal
       
  1514 	receiver:self
       
  1515 	selector:#arcSin
       
  1516 	arguments:#()
       
  1517 	errorString:'bad receiver in arcSin'
       
  1518 
       
  1519     "
       
  1520      -10 asLongFloat arcSin
       
  1521      1 asLongFloat arcSin  
       
  1522      0.5 asLongFloat arcSin  
       
  1523     "
       
  1524 !
       
  1525 
       
  1526 arcSinh
       
  1527     "return the hyperbolic arcsine of myself (I am interpreted as radians).
       
  1528      Raises an exception, if the receiver is not in -1..1"
       
  1529  
       
  1530 %{  /* NOCONTEXT */
       
  1531 #if defined(LONG_asinh)
       
  1532  
       
  1533     LONGFLOAT val, rslt;
       
  1534     OBJ newFloat;
       
  1535  
       
  1536     val = __longFloatVal(self);
       
  1537  
       
  1538 # ifdef WIN32 /* dont know (yet) how to suppress the warnBox opened by win32 */
       
  1539     if ((val >= -1.0) && (val <= 1.0))
       
  1540 # endif
       
  1541     {
       
  1542         __threadErrno = 0;
       
  1543         rslt = LONG_asinh(val);
       
  1544 # ifdef LONG_isnan
       
  1545         if (! LONG_isnan(rslt))
       
  1546 # endif
       
  1547         {
       
  1548             if (__threadErrno == 0) {
       
  1549                 __qMKLFLOAT(newFloat, rslt);
       
  1550                 RETURN ( newFloat );
       
  1551             }
       
  1552         }
       
  1553     }
       
  1554 #endif
       
  1555 %}.
       
  1556     ^ self class
       
  1557         raise:#domainErrorSignal
       
  1558         receiver:self
       
  1559         selector:#arcSinh
       
  1560         arguments:#()
       
  1561         errorString:'bad receiver in arcSinh'
       
  1562  
       
  1563     "
       
  1564      -10 asLongFloat arcSinh
       
  1565      1 asLongFloat arcSinh
       
  1566      0.5 asLongFloat arcSinh
       
  1567     "
       
  1568 !
       
  1569 
       
  1570 arcTan
       
  1571     "return the arctangent of myself as radians"
       
  1572 
       
  1573 %{  /* NOCONTEXT */
       
  1574 #if defined(LONG_atan)
       
  1575 
       
  1576     LONGFLOAT rslt;
       
  1577     OBJ newFloat;
       
  1578 
       
  1579     __threadErrno = 0;
       
  1580     rslt = LONG_atan(__longFloatVal(self));
       
  1581 # ifdef LONG_isnan
       
  1582     if (! LONG_isnan(rslt))
       
  1583 # endif
       
  1584     {
       
  1585         if (__threadErrno == 0) {
       
  1586 	    __qMKLFLOAT(newFloat, rslt);
       
  1587 	    RETURN ( newFloat );
       
  1588 	}
       
  1589     }
       
  1590 #endif
       
  1591 %}.
       
  1592     ^ self class
       
  1593 	raise:#domainErrorSignal
       
  1594 	receiver:self
       
  1595 	selector:#arcTan
       
  1596 	arguments:#()
       
  1597 	errorString:'bad receiver in arcTan'
       
  1598 !
       
  1599 
       
  1600 arcTanh
       
  1601     "return the hyperbolic arctangent of myself as radians"
       
  1602  
       
  1603 %{  /* NOCONTEXT */
       
  1604 #if defined(LONG_atanh)
       
  1605  
       
  1606     LONGFLOAT rslt;
       
  1607     OBJ newFloat;
       
  1608  
       
  1609     __threadErrno = 0;
       
  1610     rslt = LONG_atanh(__longFloatVal(self));
       
  1611 # ifdef LONG_isnan
       
  1612     if (! LONG_isnan(rslt))
       
  1613 # endif
       
  1614     {
       
  1615         if (__threadErrno == 0) {
       
  1616             __qMKLFLOAT(newFloat, rslt);
       
  1617             RETURN ( newFloat );
       
  1618         }
       
  1619     }
       
  1620 #endif
       
  1621 %}.
       
  1622     ^ self class
       
  1623         raise:#domainErrorSignal
       
  1624         receiver:self
       
  1625         selector:#arcTanh
       
  1626         arguments:#()
       
  1627         errorString:'bad receiver in arcTanh'
       
  1628 !
       
  1629 
       
  1630 cos
       
  1631     "return the cosine of myself interpreted as radians"
       
  1632 
       
  1633 %{  /* NOCONTEXT */
       
  1634 #if defined(LONG_cos)
       
  1635 
       
  1636     LONGFLOAT rslt;
       
  1637     OBJ newFloat;
       
  1638 
       
  1639     __threadErrno = 0;
       
  1640     rslt = LONG_cos(__longFloatVal(self));
       
  1641 # ifdef LONG_isnan
       
  1642     if (! LONG_isnan(rslt))
       
  1643 # endif
       
  1644     if (__threadErrno == 0) {
       
  1645 	__qMKLFLOAT(newFloat, rslt);
       
  1646 	RETURN ( newFloat );
       
  1647     }
       
  1648 #endif
       
  1649 %}.
       
  1650     ^ self class
       
  1651 	raise:#domainErrorSignal
       
  1652 	receiver:self
       
  1653 	selector:#cos
       
  1654 	arguments:#()
       
  1655 	errorString:'bad receiver in cos'
       
  1656 !
       
  1657 
       
  1658 cosh
       
  1659     "return the hyperbolic cosine of myself interpreted as radians"
       
  1660  
       
  1661 %{  /* NOCONTEXT */
       
  1662 #if defined(LONG_cosh)
       
  1663  
       
  1664     LONGFLOAT rslt;
       
  1665     OBJ newFloat;
       
  1666  
       
  1667     __threadErrno = 0;
       
  1668     rslt = LONG_cosh(__longFloatVal(self));
       
  1669 # ifdef LONG_isnan
       
  1670     if (! LONG_isnan(rslt))
       
  1671 # endif
       
  1672     if (__threadErrno == 0) {
       
  1673         __qMKLFLOAT(newFloat, rslt);
       
  1674         RETURN ( newFloat );
       
  1675     }
       
  1676 #endif
       
  1677 %}.
       
  1678     ^ self class
       
  1679         raise:#domainErrorSignal
       
  1680         receiver:self
       
  1681         selector:#cosh
       
  1682         arguments:#()
       
  1683         errorString:'bad receiver in cosh'
       
  1684 !
       
  1685 
       
  1686 sin
       
  1687     "return the sine of myself interpreted as radians"
       
  1688 
       
  1689 %{  /* NOCONTEXT */
       
  1690 #if defined(LONG_sin)
       
  1691 
       
  1692     LONGFLOAT rslt;
       
  1693     OBJ newFloat;
       
  1694 
       
  1695     __threadErrno = 0;
       
  1696     rslt = LONG_sin(__longFloatVal(self));
       
  1697 # ifdef LINUX /* and maybe others */
       
  1698     if (! isnan(rslt))
       
  1699 # endif
       
  1700     if (__threadErrno == 0) {
       
  1701 	__qMKLFLOAT(newFloat, rslt);
       
  1702 	RETURN ( newFloat );
       
  1703     }
       
  1704 #endif
       
  1705 %}.
       
  1706     ^ self class
       
  1707 	raise:#domainErrorSignal
       
  1708 	receiver:self
       
  1709 	selector:#sin
       
  1710 	arguments:#()
       
  1711 	errorString:'bad receiver in sin'
       
  1712 !
       
  1713 
       
  1714 sinh
       
  1715     "return the hyperbolic sine of myself interpreted as radians"
       
  1716  
       
  1717 %{  /* NOCONTEXT */
       
  1718 #if defined(LONG_sinh)
       
  1719  
       
  1720     LONGFLOAT rslt;
       
  1721     OBJ newFloat;
       
  1722  
       
  1723     __threadErrno = 0;
       
  1724     rslt = LONG_sinh(__longFloatVal(self));
       
  1725 # ifdef LINUX /* and maybe others */
       
  1726     if (! isnan(rslt))
       
  1727 # endif
       
  1728     if (__threadErrno == 0) {
       
  1729         __qMKLFLOAT(newFloat, rslt);
       
  1730         RETURN ( newFloat );
       
  1731     }
       
  1732 #endif
       
  1733 %}.
       
  1734     ^ self class
       
  1735         raise:#domainErrorSignal
       
  1736         receiver:self
       
  1737         selector:#sinh
       
  1738         arguments:#()
       
  1739         errorString:'bad receiver in sinh'
       
  1740 !
       
  1741 
       
  1742 tan
       
  1743     "return the tangens of myself interpreted as radians"
       
  1744 
       
  1745 %{  /* NOCONTEXT */
       
  1746 #if defined(LONG_tan)
       
  1747 
       
  1748     LONGFLOAT rslt;
       
  1749     OBJ newFloat;
       
  1750 
       
  1751     __threadErrno = 0;
       
  1752     rslt = LONG_tan(__longFloatVal(self));
       
  1753 # ifdef LINUX /* and maybe others */
       
  1754     if (! isnan(rslt))
       
  1755 # endif
       
  1756     if (__threadErrno == 0) {
       
  1757 	__qMKLFLOAT(newFloat, rslt);
       
  1758 	RETURN ( newFloat );
       
  1759     }
       
  1760 #endif
       
  1761 %}.
       
  1762     ^ self class
       
  1763 	raise:#domainErrorSignal
       
  1764 	receiver:self
       
  1765 	selector:#tan
       
  1766 	arguments:#()
       
  1767 	errorString:'bad receiver in tan'
       
  1768 !
       
  1769 
       
  1770 tanh
       
  1771     "return the hyperbolic tangens of myself interpreted as radians"
       
  1772  
       
  1773 %{  /* NOCONTEXT */
       
  1774 #if defined(LONG_tanh)
       
  1775  
       
  1776     LONGFLOAT rslt;
       
  1777     OBJ newFloat;
       
  1778  
       
  1779     __threadErrno = 0;
       
  1780     rslt = LONG_tanh(__longFloatVal(self));
       
  1781 # ifdef LINUX /* and maybe others */
       
  1782     if (! isnan(rslt))
       
  1783 # endif
       
  1784     if (__threadErrno == 0) {
       
  1785         __qMKLFLOAT(newFloat, rslt);
       
  1786         RETURN ( newFloat );
       
  1787     }
       
  1788 #endif
       
  1789 %}.
       
  1790     ^ self class
       
  1791         raise:#domainErrorSignal
       
  1792         receiver:self
       
  1793         selector:#tanh
       
  1794         arguments:#()
       
  1795         errorString:'bad receiver in tanh'
       
  1796 ! !
       
  1797 
  1796 !LongFloat methodsFor:'truncation & rounding'!
  1798 !LongFloat methodsFor:'truncation & rounding'!
  1797 
  1799 
  1798 ceiling
  1800 ceiling
  1799     "return the smallest integer which is greater or equal to the receiver."
  1801     "return the smallest integer which is greater or equal to the receiver."
  1800 
  1802 
  2030 ! !
  2032 ! !
  2031 
  2033 
  2032 !LongFloat class methodsFor:'documentation'!
  2034 !LongFloat class methodsFor:'documentation'!
  2033 
  2035 
  2034 version
  2036 version
  2035     ^ '$Header: /cvs/stx/stx/libbasic/LongFloat.st,v 1.28 2003-06-17 08:57:50 cg Exp $'
  2037     ^ '$Header: /cvs/stx/stx/libbasic/LongFloat.st,v 1.29 2003-06-17 09:12:22 cg Exp $'
  2036 ! !
  2038 ! !