Ignore:
Timestamp:
May 7, 2007, 4:22:52 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

#_fullcompileで検出されたエラーの修正(明らかに判るもののみ)

File:
1 edited

Legend:

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

    r233 r237  
    194194
    195195    Static Function Floor(value As Double) As Long
    196         return Int(value)
     196        Return Int(value)
    197197    End Function
    198198
     
    201201    'GetType
    202202
    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)
    212211            Else
    213                 q=Int(q-0.5)
     212                q = Int(q - 0.5)
    214213            End If
    215214        End If
    216         If x-y*q=0 then
    217             If x>0 then
    218                 return +0
     215        If x - y * q = 0 Then
     216            If x > 0 Then
     217                Return +0
    219218            Else
    220                 return -0
     219                Return -0
    221220            End If
    222221        Else
    223             return x-y*q
     222            Return x-y*q
    224223        End If
    225224    End Function
     
    252251
    253252    Static Function Log10(x As Double) As Double
    254         Return Math.Log(x) / Math.Log(10)
     253        Return Math.Log(x) / _System_Ln10
    255254    End Function
    256255
     
    582581
    583582    Static Function Truncate(x As Double) As Double
    584         return Fix(x)
     583        Return Fix(x)
    585584    End Function
    586585
     
    611610Const _System_HalfPI = (_System_PI * 0.5)
    612611Const _System_InverseHalfPI = (2 / _System_PI) '1 / (PI / 2)
     612Const _System_Ln10 = 2.3025850929940456840179914546844 '10の自然対数
    613613
    614614#endif '__SYSTEM_MATH_AB__
Note: See TracChangeset for help on using the changeset viewer.