Changeset 335 for trunk/Include/com/decimal.ab
- Timestamp:
- Sep 18, 2007, 12:10:41 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/com/decimal.ab
r267 r335 1 1 ' com/decimal.ab 2 2 3 #require <oleauto.ab>3 '#require <oleauto.ab> 4 4 #require <com/variant.ab> 5 5 #require <com/currency.ab> … … 14 14 15 15 Sub Decimal(d As Decimal) 16 dec = d 16 ' dec = d なぜかコンパイルできない 17 memcpy(VarPtr(dec), VarPtr(d), Len(dec)) 17 18 End Sub 18 19 … … 56 57 VarDecFromR8(x, dec) 57 58 End Sub 58 59 /* 59 60 Const Function Operator() As Variant 60 61 Return New Variant(This) … … 195 196 End Function 196 197 */ 198 /* 197 199 Const Function Operator +() As Decimal 198 200 Return New Decimal(dec) 199 201 End Function 200 202 */ 201 203 Const Function Operator -() As Decimal 202 204 Dim ret = New Decimal … … 211 213 End Function 212 214 213 Const Function Operator *(y As Long) As Decimal214 Dim ret = New Decimal215 VarDecMulI4(This.dec, y, ret.dec)216 Return ret217 End Function218 219 Const Function Operator *(y As Int64) As Decimal220 Dim ret = New Decimal221 VarDecMulI8(This.dec, y, ret.dec)222 Return ret223 End Function224 225 215 Const Function Operator /(y As Decimal) As Decimal 226 216 Dim ret = New Decimal … … 242 232 243 233 Static Function Compare(x As Decimal, y As Decimal) As HRESULT 244 Return VarDecCmp(x , y)234 Return VarDecCmp(x.dec, y.dec) 245 235 End Function 246 236 247 237 Static Function Compare(x As Decimal, y As Double) As HRESULT 248 Return VarDecCmpR8(x , y)238 Return VarDecCmpR8(x.dec, y) 249 239 End Function 250 240 251 241 Static Function Compare(x As Double, y As Decimal) As HRESULT 252 Dim ret = VarDecCmpR8(y , x)242 Dim ret = VarDecCmpR8(y.dec, x) 253 243 Select Case ret 254 244 Case VARCMP_LT … … 303 293 Const Function Operator <=(y As Decimal) As Boolean 304 294 Dim c = Compare(This, y) 305 Return result = VARCMP_LT Or result= VARCMP_EQ295 Return c = VARCMP_LT Or c = VARCMP_EQ 306 296 End Function 307 297 308 298 Const Function Operator <=(y As Double) As Boolean 309 299 Dim c = Compare(This, y) 310 Return result = VARCMP_LT Or result= VARCMP_EQ300 Return c = VARCMP_LT Or c = VARCMP_EQ 311 301 End Function 312 302 313 303 Const Function Operator >=(y As Decimal) As Boolean 314 304 Dim c = Compare(This, y) 315 Return result = VARCMP_GT Or result= VARCMP_EQ305 Return c = VARCMP_GT Or c = VARCMP_EQ 316 306 End Function 317 307 318 308 Const Function Operator >=(y As Double) As Boolean 319 309 Dim c = Compare(This, y) 320 Return result = VARCMP_GT Or result= VARCMP_EQ310 Return c = VARCMP_GT Or c = VARCMP_EQ 321 311 End Function 322 312
Note:
See TracChangeset
for help on using the changeset viewer.