Added pf_number_mlt() whcih scales to the smaller of the two fixed-point numbers

This commit is contained in:
hyunghwan.chung
2019-01-10 15:28:37 +00:00
parent 9cd0b28933
commit 5101228c39
3 changed files with 31 additions and 2 deletions

View File

@ -126,6 +126,18 @@ class(#limited) Number(Magnitude)
self primitiveFailed.
}
method mul: aNumber
{
<primitive: #_number_mul>
self primitiveFailed.
}
method mlt: aNumber
{
<primitive: #_number_mlt>
self primitiveFailed.
}
method div: aNumber
{
## integer division rounded toward zero

View File

@ -208,8 +208,6 @@ extend MyObject
[ (16r2dd01fc06c265c8163ac729b49d890939826ce3dd rem: 16r3b9aca00) = 394876893 ],
[ (16rFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF bitAnd: 16r1111111111111111111111111111111111111111) = 16r1111111111111111111111111111111111111111 ],
## 60-64
[ (-0.1233 * 999999.123) = -123299.8918 ],
[ (-0.1233 * 999999.123) asString = '-123299.8918' ],
@ -218,6 +216,8 @@ extend MyObject
[ (1.234 - 1.234) = 0 ], ## 0.000
## 65-69
[ (10.12 * 20.345) = 205.891 ],
[ (10.12 mlt: 20.345) = 205.89 ],
[ (-123897128378912738912738917.112323131233 div: 123.1) = -1006475453931053931053931.089458352000 ],
[ (-1006475453931053931053931.089458352000 * 123.1) = -123897128378912738912738917.112323131200 ],