Changeset 237 for Include/Classes/System/Math.ab
- Timestamp:
- May 7, 2007, 4:22:52 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Math.ab
r233 r237 194 194 195 195 Static Function Floor(value As Double) As Long 196 return Int(value)196 Return Int(value) 197 197 End Function 198 198 … … 201 201 'GetType 202 202 203 Static Function IEEERemainder(value1 As Double, value2 As Double) As Double 204 Dim q As Double 205 If value2=0 then return _System_GetNaN() 206 q=value1/value2 207 If q<>Int(q) then 208 If q+0.5<>Int(q+0.5) then 209 q=Int(q+0.5) 210 ElseIf Int(q+0.5)=Int(q*2+1)/2 then 211 q=Int(q+0.5) 203 Static Function IEEERemainder(x As Double, y As Double) As Double 204 If y = 0 Then Return _System_GetNaN() 205 Dim q = x / y 206 If q <> Int(q) Then 207 If q + 0.5 <> Int(q + 0.5) Then 208 q = Int(q + 0.5) 209 ElseIf Int(q + 0.5) = Int(q * 2 + 1) / 2 Then 210 q = Int(q + 0.5) 212 211 Else 213 q =Int(q-0.5)212 q = Int(q - 0.5) 214 213 End If 215 214 End If 216 If x -y*q=0 then217 If x >0 then218 return +0215 If x - y * q = 0 Then 216 If x > 0 Then 217 Return +0 219 218 Else 220 return -0219 Return -0 221 220 End If 222 221 Else 223 return x-y*q222 Return x-y*q 224 223 End If 225 224 End Function … … 252 251 253 252 Static Function Log10(x As Double) As Double 254 Return Math.Log(x) / Math.Log(10)253 Return Math.Log(x) / _System_Ln10 255 254 End Function 256 255 … … 582 581 583 582 Static Function Truncate(x As Double) As Double 584 return Fix(x)583 Return Fix(x) 585 584 End Function 586 585 … … 611 610 Const _System_HalfPI = (_System_PI * 0.5) 612 611 Const _System_InverseHalfPI = (2 / _System_PI) '1 / (PI / 2) 612 Const _System_Ln10 = 2.3025850929940456840179914546844 '10の自然対数 613 613 614 614 #endif '__SYSTEM_MATH_AB__
Note:
See TracChangeset
for help on using the changeset viewer.