Changeset 3228
- Timestamp:
- 02/19/08 03:07:29 (5 months ago)
- Files:
-
- trunk/tango/math/IEEE.d (modified) (4 diffs)
- trunk/tango/math/Math.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tango/math/IEEE.d
r3192 r3228 880 880 return (*p & 0x7FF0_0000_0000_0000 == 0x7FF0_0000_0000_0000) && *p & 0x000F_FFFF_FFFF_FFFF; 881 881 } else static if (real.mant_dig==64) { // real80 882 ushort e = EXPMASK & (cast(ushort *)&x)[EXPONENTPOS_SHORT]; 882 // Prevent a ridiculous warning (why does (ushort | ushort) get promoted to int???) 883 ushort e = cast(ushort)(EXPMASK & (cast(ushort *)&x)[EXPONENTPOS_SHORT]); 883 884 ulong* ps = cast(ulong *)&x; 884 885 return e == 0x7FFF && … … 925 926 ushort *p = cast(ushort *)&d; 926 927 version(LittleEndian) { 927 ushort e = p[3] & 0x7FF0; 928 ushort e = p[3]; 929 e &= 0x7FF0; 928 930 } else { 929 ushort e = p[0] &0x7FF0;931 ushort e = p[0]; e &= 0x7FF0; 930 932 } 931 933 return e!=0 && e != 0x7FF0; … … 941 943 return isNormal((cast(double*)&x)[1]); 942 944 } else static if (real.mant_dig == 64) { // real80 943 ushort e = EXPMASK & (cast(ushort *)&x)[EXPONENTPOS_SHORT]; 945 // ridiculous DMD warning 946 ushort e = cast(ushort)(EXPMASK & (cast(ushort *)&x)[EXPONENTPOS_SHORT]); 944 947 return (e != 0x7FFF && e!=0); 945 948 } else static if (real.mant_dig == 113) { // quadruple … … 1137 1140 && (ps[MANTISSA_MSB] & 0x7FFF_FFFF_FFFF_FFFF) == 0x7FFF_0000_0000_0000; 1138 1141 } else { // real80 1139 ushort e = EXPMASK & (cast(ushort *)&x)[EXPONENTPOS_SHORT];1142 ushort e = cast(ushort)(EXPMASK & (cast(ushort *)&x)[EXPONENTPOS_SHORT]); 1140 1143 ulong* ps = cast(ulong *)&x; 1141 1144 trunk/tango/math/Math.d
r2706 r3228 78 78 79 79 const real E = 2.7182818284590452354L; /** e */ 80 const real LOG2T = 0x1.a934f0979a3715fcp+1 ; /** log<sub>2</sub>10 */ // 3.32193 fldl2t81 const real LOG2E = 0x1.71547652b82fe178p+0 ; /** log<sub>2</sub>e */ // 1.4427 fldl2e82 const real LOG2 = 0x1.34413509f79fef32p-2 ; /** log<sub>10</sub>2 */ // 0.30103 fldlg280 const real LOG2T = 0x1.a934f0979a3715fcp+1L; /** log<sub>2</sub>10 */ // 3.32193 fldl2t 81 const real LOG2E = 0x1.71547652b82fe178p+0L; /** log<sub>2</sub>e */ // 1.4427 fldl2e 82 const real LOG2 = 0x1.34413509f79fef32p-2L; /** log<sub>10</sub>2 */ // 0.30103 fldlg2 83 83 const real LOG10E = 0.43429448190325182765L; /** log<sub>10</sub>e */ 84 const real LN2 = 0x1.62e42fefa39ef358p-1 ; /** ln 2 */ // 0.693147 fldln284 const real LN2 = 0x1.62e42fefa39ef358p-1L; /** ln 2 */ // 0.693147 fldln2 85 85 const real LN10 = 2.30258509299404568402L; /** ln 10 */ 86 const real PI = 0x1.921fb54442d1846ap+1 ; /** π */ // 3.14159 fldpi86 const real PI = 0x1.921fb54442d1846ap+1L; /** π */ // 3.14159 fldpi 87 87 const real PI_2 = 1.57079632679489661923L; /** π / 2 */ 88 88 const real PI_4 = 0.78539816339744830962L; /** π / 4 */ … … 96 96 //const real SQRT2PI = 2.50662827463100050242E0L; /** √(2 π) */ 97 97 98 const real MAXLOG = 0x1.62e42fefa39ef358p+13 ; /** log(real.max) */99 const real MINLOG = -0x1.6436716d5406e6d8p+13 ; /** log(real.min*real.epsilon) */100 const real EULERGAMMA = 0.57721_56649_01532_86060_65120_90082_40243_10421_59335_93992 ; /** Euler-Mascheroni constant 0.57721566.. */98 const real MAXLOG = 0x1.62e42fefa39ef358p+13L; /** log(real.max) */ 99 const real MINLOG = -0x1.6436716d5406e6d8p+13L; /** log(real.min*real.epsilon) */ 100 const real EULERGAMMA = 0.57721_56649_01532_86060_65120_90082_40243_10421_59335_93992L; /** Euler-Mascheroni constant 0.57721566.. */ 101 101 102 102 /*












