Changeset 53 for Include/Classes
- Timestamp:
- Jan 8, 2007, 6:29:41 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Math.ab
r23 r53 500 500 501 501 Static Function Sin(value As Double) As Double 502 If IsNaN( number) Then503 Return number504 ElseIf IsInf( number) Then502 If IsNaN(value) Then 503 Return value 504 ElseIf IsInf(value) Then 505 505 Return _System_GetNaN() 506 506 Exit Function 507 507 End If 508 508 509 Dim k As Integer509 Dim k As Long 510 510 Dim t As Double 511 511 512 t = urTan( x* 0.5, k)512 t = urTan(value * 0.5, 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 'ToString590 591 589 Static Function Truncate(x As Double) As Double 592 590 return Fix(x) 593 591 End Function 594 592 595 'Private593 Private 596 594 Static Function urTan(x As Double, ByRef k As Long) As Double 597 595 Dim i As Long … … 599 597 600 598 If x >= 0 Then 601 k = Fix(x * _System_InverseHalfPI) + 0.5602 Else 603 k = Fix(x * _System_InverseHalfPI) - 0.5599 k = ( ( Fix(x * _System_InverseHalfPI) As Double ) + 0.5 ) As Long 600 Else 601 k = ( ( Fix(x * _System_InverseHalfPI) As Double ) - 0.5 ) As Long 604 602 End If 605 603 x = (x - (3217.0 / 2048.0) * k) + _System_D * k
Note:
See TracChangeset
for help on using the changeset viewer.