Ignore:
Timestamp:
May 19, 2007, 3:29:33 PM (18 years ago)
Author:
イグトランス (egtra)
Message:

VersionTest追加、Log1p追加

File:
1 edited

Legend:

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

    r244 r257  
    232232            Dim tmp = x * _System_InverseSqrt2
    233233            Dim p = VarPtr(tmp) As *QWord
    234             Dim m = p[0] And &h7FF0000000000000
     234            Dim m = GetQWord(p) And &h7FF0000000000000
    235235            Dim k = ((m >> 52) As DWord) As Long - 1022
    236             p[0] = m + &h0010000000000000
     236            SetQWord(p, m + &h0010000000000000)
    237237            x /= tmp
    238 
    239             x--
    240             Dim s = 0 As Double
    241             Dim i = _System_Log_N As Long
    242             While i >= 1
    243                 Dim t = (i * x) As Double
    244                 s = t / (2 + t / (2 * i + 1 + s))
    245                 i--
    246             Wend
    247             Log = _System_LOG2 * k + x / (1 + s)
     238            Log = _System_LOG2 * k + _System_Log1p(x - 1)
    248239        End If
    249240    End Function
     
    602593    End Function
    603594Private
    604     Static Const _System_Log_N = 7 As Long
    605595    Static Const _System_Atan_N = 20 As Long
    606596    Static Const _System_UrTan_N = 17 As Long
Note: See TracChangeset for help on using the changeset viewer.