- Timestamp:
- Feb 12, 2007, 11:47:19 AM (18 years ago)
- Location:
- Include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Math.ab
r91 r92 147 147 End If 148 148 149 Return Sin(_System_HalfPI - Abs(x))149 Return Math.Sin((_System_HalfPI - Abs(x)) As Double) 150 150 End Function 151 151 … … 510 510 Dim t As Double 511 511 512 t = urTan( value * 0.5, k)512 t = urTan((value * 0.5) As Double, k) 513 513 t = 2 * t / (1 + t * t) 514 514 If (k And 1) = 0 Then 'k mod 2 = 0 Then … … 587 587 End Function 588 588 589 'ToString 590 589 591 Static Function Truncate(x As Double) As Double 590 592 return Fix(x) 591 593 End Function 592 594 593 Private595 'Private 594 596 Static Function urTan(x As Double, ByRef k As Long) As Double 595 597 Dim i As Long … … 597 599 598 600 If x >= 0 Then 599 k = ( ( Fix(x * _System_InverseHalfPI) As Double ) + 0.5 ) As Long600 Else 601 k = ( ( Fix(x * _System_InverseHalfPI) As Double ) - 0.5 ) As Long601 k = Fix(x * _System_InverseHalfPI) + 0.5 602 Else 603 k = Fix(x * _System_InverseHalfPI) - 0.5 602 604 End If 603 605 x = (x - (3217.0 / 2048.0) * k) + _System_D * k -
Include/basic/function.sbp
r57 r92 139 139 Function _System_SetSign(x As Double, isNegative As Long) As Double 140 140 #ifdef _WIN64 141 SetQWord( VarPtr(CopySign), (GetQWord(VarPtr(x)) And &h7fffffffffffffff) Or (isNegative << 63))141 SetQWord(AddressOf(CopySign), (GetQWord(VarPtr(x)) And &h7fffffffffffffff) Or (isNegative << 63)) 142 142 #else 143 SetDWord( VarPtr(CopySign), GetDWord(VarPtr(x)))144 SetDWord( VarPtr(CopySign) + SizeOf (DWord), GetQWord(VarPtr(x) + SizeOf (DWord)) And &h7fffffff Or (isNegative << 31))143 SetDWord(AddressOf(CopySign), GetDWord(VarPtr(x))) 144 SetDWord(AddressOf(CopySign) + SizeOf (DWord), GetQWord(VarPtr(x) + SizeOf (DWord)) And &h7fffffff Or (isNegative << 31)) 145 145 #endif 146 146 End Function … … 175 175 176 176 Function CDWord(num As Double) As DWord 177 CDWord=num 177 CDWord=num As DWord 178 178 End Function 179 179 180 180 Function CInt(number As Double) As Long 181 CInt=number 181 CInt=number As Long 182 182 End Function 183 183 184 184 Function CSng(number As Double) As Single 185 CSng=number 185 CSng=number As Single 186 186 End Function 187 187 … … 279 279 280 280 Function Sin(number As Double) As Double 281 Sin = Math.Si n(number)281 Sin = Math.Sign(number) 282 282 End Function 283 283 … … 322 322 p[0] = 0 323 323 nan = _System_GetInf(/*x,*/ FALSE) 324 IsNaNOrInf = (memcmp(p , VarPtr(nan), SizeOf (Double)) = 0)324 IsNaNOrInf = (memcmp(p As BytePtr, VarPtr(nan), SizeOf (Double)) = 0) 325 325 End Function 326 326
Note:
See TracChangeset
for help on using the changeset viewer.