Ignore:
Timestamp:
Sep 18, 2007, 12:10:41 AM (17 years ago)
Author:
イグトランス (egtra)
Message:

SPrintF関連の追加。関数FloatToChars, FormatFloatE, FormatIntegerUと列挙体FormatFlags。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/com/decimal.ab

    r267 r335  
    11' com/decimal.ab
    22
    3 #require <oleauto.ab>
     3'#require <oleauto.ab>
    44#require <com/variant.ab>
    55#require <com/currency.ab>
     
    1414
    1515    Sub Decimal(d As Decimal)
    16         dec = d
     16'       dec = d なぜかコンパイルできない
     17        memcpy(VarPtr(dec), VarPtr(d), Len(dec))
    1718    End Sub
    1819
     
    5657        VarDecFromR8(x, dec)
    5758    End Sub
    58 
     59/*
    5960    Const Function Operator() As Variant
    6061        Return New Variant(This)
     
    195196    End Function
    196197*/
     198/*
    197199    Const Function Operator +() As Decimal
    198200        Return New Decimal(dec)
    199201    End Function
    200 
     202*/
    201203    Const Function Operator -() As Decimal
    202204        Dim ret = New Decimal
     
    211213    End Function
    212214
    213     Const Function Operator *(y As Long) As Decimal
    214         Dim ret = New Decimal
    215         VarDecMulI4(This.dec, y, ret.dec)
    216         Return ret
    217     End Function
    218 
    219     Const Function Operator *(y As Int64) As Decimal
    220         Dim ret = New Decimal
    221         VarDecMulI8(This.dec, y, ret.dec)
    222         Return ret
    223     End Function
    224 
    225215    Const Function Operator /(y As Decimal) As Decimal
    226216        Dim ret = New Decimal
     
    242232
    243233    Static Function Compare(x As Decimal, y As Decimal) As HRESULT
    244         Return VarDecCmp(x, y)
     234        Return VarDecCmp(x.dec, y.dec)
    245235    End Function
    246236
    247237    Static Function Compare(x As Decimal, y As Double) As HRESULT
    248         Return VarDecCmpR8(x, y)
     238        Return VarDecCmpR8(x.dec, y)
    249239    End Function
    250240
    251241    Static Function Compare(x As Double, y As Decimal) As HRESULT
    252         Dim ret = VarDecCmpR8(y, x)
     242        Dim ret = VarDecCmpR8(y.dec, x)
    253243        Select Case ret
    254244            Case VARCMP_LT
     
    303293    Const Function Operator <=(y As Decimal) As Boolean
    304294        Dim c = Compare(This, y)
    305         Return result = VARCMP_LT Or result = VARCMP_EQ
     295        Return c = VARCMP_LT Or c = VARCMP_EQ
    306296    End Function
    307297
    308298    Const Function Operator <=(y As Double) As Boolean
    309299        Dim c = Compare(This, y)
    310         Return result = VARCMP_LT Or result = VARCMP_EQ
     300        Return c = VARCMP_LT Or c = VARCMP_EQ
    311301    End Function
    312302
    313303    Const Function Operator >=(y As Decimal) As Boolean
    314304        Dim c = Compare(This, y)
    315         Return result = VARCMP_GT Or result = VARCMP_EQ
     305        Return c = VARCMP_GT Or c = VARCMP_EQ
    316306    End Function
    317307
    318308    Const Function Operator >=(y As Double) As Boolean
    319309        Dim c = Compare(This, y)
    320         Return result = VARCMP_GT Or result = VARCMP_EQ
     310        Return c = VARCMP_GT Or c = VARCMP_EQ
    321311    End Function
    322312
Note: See TracChangeset for help on using the changeset viewer.