Changeset 14


Ignore:
Timestamp:
Nov 27, 2006, 1:20:38 AM (18 years ago)
Author:
イグトランス (egtra)
Message:

bug fix

File:
1 edited

Legend:

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

    r1 r14  
    1 ' Math.ab
     1' Classes/System/Math.ab
    22
    33#ifndef __SYSTEM_MATH_AB__
     
    104104        For i = _System_Atan_N To 1 Step -1
    105105            Dim t As Double
    106             t = i * number
     106            t = i * x
    107107            dbl = (t * t) / (2 * i + 1 + dbl)
    108108        Next
     
    128128    End Function
    129129
    130     Static Function BigMul(value1 As Long, value2 As Long) As Int64
    131         Return (value1 As Int64) * value2
     130    Static Function BigMul(x As Long, y As Long) As Int64
     131        Return (x As Int64) * y
    132132    End Function
    133133
     
    140140    End Function
    141141
    142     Static Function Cos(value As Double) As Double
    143         If IsNaN(number) Then
    144             Return number
    145         ElseIf IsInf(number) Then
     142    Static Function Cos(x As Double) As Double
     143        If IsNaN(x) Then
     144            Return x
     145                ElseIf IsInf(x) Then
    146146            Return _System_GetNaN()
    147147        End If
    148148
    149         Return Sin(_System_HalfPI - Abs(number))
     149        Return Sin(_System_HalfPI - Abs(x))
    150150    End Function
    151151
     
    156156    End Function
    157157
    158     Static Function DivRem(value1 As Long, value2 As Long, ByRef ret As Long) As Long
    159         ret = value1 Mod value2
    160         return value1 \ value2
    161     End Function
    162 
    163     Static Function DivRem(value1 As Int64, value2 As Int64, ByRef ret As Int64) As Int64
    164         ret = value1 - (value1 \ value2) * value2
    165         return value1 \ value2
     158    Static Function DivRem(x As Long, y As Long, ByRef ret As Long) As Long
     159        ret = x Mod y
     160        return x \ y
     161    End Function
     162
     163    Static Function DivRem(x As Int64, y As Int64, ByRef ret As Int64) As Int64
     164        ret = x - (x \ y) * y
     165        return x \ y
    166166    End Function
    167167
    168168    'Equals
    169169
    170     Static Function Exp(value As Double) As Double
     170    Static Function Exp(x As Double) As Double
    171171        If IsNaN(x) Then
    172172            Return x
     
    182182
    183183        If x >= 0 Then
    184             k= Fix(x / _System_LOG2 + 0.5)
    185         Else
    186             k= Fix(x / _System_LOG2 - 0.5)
     184            k = Fix(x / _System_LOG2 + 0.5)
     185        Else
     186            k = Fix(x / _System_LOG2 - 0.5)
    187187        End If
    188188
     
    423423    End Function
    424424
    425     Static Function Pow(value1 As Double, value2 As Double) As Double
    426         return value1 ^ value2
     425    Static Function Pow(x As Double, y As Double) As Double
     426        return pow(x, y)
    427427    End Function
    428428
     
    532532        Dim s As Double, last As Double
    533533        Dim i As *Word, j As Long, jj As Long, k As Long
    534         If number > 0 Then
    535             If IsInf(number) Then
     534        If x > 0 Then
     535            If IsInf(x) Then
    536536                Sqrt = x
    537537            Else
     
    548548                Loop While s <> last
    549549            End If
    550         If x < 0 Then
     550        ElseIf x < 0 Then
    551551            Sqr = _System_GetNaN()
    552552        Else
     
    556556    End Function
    557557
    558     Static Function Tan(value As Double) As Double
    559         If IsNaN(number) Then
    560             Tan = number
     558    Static Function Tan(x As Double) As Double
     559        If IsNaN(x) Then
     560            Tan = x
    561561            Exit Function
    562         ElseIf IsInf(number) Then
     562        ElseIf IsInf(x) Then
    563563            Tan = _System_GetNaN()
    564564            Exit Function
     
    593593    End Function
    594594
    595 Private
     595'Private
    596596    Static Function urTan(x As Double, ByRef k As Long) As Double
    597597        Dim i As Long
Note: See TracChangeset for help on using the changeset viewer.