Changeset 53 for Include/Classes


Ignore:
Timestamp:
Jan 8, 2007, 6:29:41 AM (18 years ago)
Author:
dai
Message:

タイプミスを修正。urTanをPrivateにした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/Math.ab

    r23 r53  
    500500
    501501    Static Function Sin(value As Double) As Double
    502         If IsNaN(number) Then
    503             Return number
    504         ElseIf IsInf(number) Then
     502        If IsNaN(value) Then
     503            Return value
     504        ElseIf IsInf(value) Then
    505505            Return _System_GetNaN()
    506506            Exit Function
    507507        End If
    508508
    509         Dim k As Integer
     509        Dim k As Long
    510510        Dim t As Double
    511511
    512         t = urTan(x * 0.5, k)
     512        t = urTan(value * 0.5, k)
    513513        t = 2 * t / (1 + t * t)
    514514        If (k And 1) = 0 Then 'k mod 2 = 0 Then
     
    587587    End Function
    588588
    589     'ToString
    590 
    591589    Static Function Truncate(x As Double) As Double
    592590        return Fix(x)
    593591    End Function
    594592
    595 'Private
     593Private
    596594    Static Function urTan(x As Double, ByRef k As Long) As Double
    597595        Dim i As Long
     
    599597
    600598        If x >= 0 Then
    601             k = Fix(x * _System_InverseHalfPI) + 0.5
    602         Else
    603             k = Fix(x * _System_InverseHalfPI) - 0.5
     599            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
    604602        End If
    605603        x = (x - (3217.0 / 2048.0) * k) + _System_D * k
Note: See TracChangeset for help on using the changeset viewer.