2019-06-27 06:29:09 +00:00
|
|
|
//
|
|
|
|
// TEST CASES for namespacing
|
|
|
|
//
|
2017-09-29 15:03:54 +00:00
|
|
|
|
2019-06-27 08:06:33 +00:00
|
|
|
#include "Moo.moo".
|
2016-03-28 13:27:03 +00:00
|
|
|
|
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
class MyObject(Object)
|
|
|
|
{
|
|
|
|
}
|
2016-03-28 13:27:03 +00:00
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
class MyObject.Donkey (MyObject)
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
2017-06-07 17:22:14 +00:00
|
|
|
var(#class) Cat := MyObject, Party := 5555, X := 'test string'.
|
|
|
|
|
|
|
|
method(#class) v { ^901982 }
|
|
|
|
}
|
2016-03-28 13:27:03 +00:00
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
pooldic MyObject.Code
|
|
|
|
{
|
2019-09-30 08:46:50 +00:00
|
|
|
FAST := 20,
|
|
|
|
FASTER := 40,
|
|
|
|
FASTER2X := self.FASTER,
|
|
|
|
FASTER3X := #(self.FAST self.FASTER self.FASTER2X #(MyObject.Donkey selfns.Donkey self.FAST FASTER) FASTER2X)
|
2016-03-28 13:27:03 +00:00
|
|
|
}
|
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
class MyObject.Donkey.Party (MyObject.Donkey)
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
2017-06-07 17:22:14 +00:00
|
|
|
}
|
2016-03-28 13:27:03 +00:00
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
class MyObject.Donkey.Party.Party (MyObject.Donkey)
|
|
|
|
{
|
2016-03-28 13:27:03 +00:00
|
|
|
}
|
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
extend MyObject.Donkey.Party
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
2017-06-07 17:22:14 +00:00
|
|
|
method(#class) party1 { ^Party }
|
|
|
|
method(#class) party2 { ^selfns.Party }
|
|
|
|
method(#class) party3 { ^self.Party }
|
|
|
|
method(#class) party4 { ^selfns.Party.Party }
|
|
|
|
|
|
|
|
method(#class) cat1 { ^Cat }
|
|
|
|
method(#class) code1 { ^MyObject.Code }
|
2016-03-28 13:27:03 +00:00
|
|
|
}
|
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
class MyObject.System.Donkey (MyObject)
|
|
|
|
{
|
|
|
|
var t1, t2.
|
|
|
|
method t1 { ^t1 }
|
|
|
|
method(#class) v { ^89123 }
|
|
|
|
}
|
2016-03-28 13:27:03 +00:00
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
class MyObject.System.Horse (Donkey)
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
2017-06-07 17:22:14 +00:00
|
|
|
method(#class) myns1 { ^selfns }
|
|
|
|
method(#class) myns2 { [^selfns] value }
|
|
|
|
|
|
|
|
method(#class) donkey1 { ^Donkey }
|
2019-06-27 06:29:09 +00:00
|
|
|
method(#class) donkey2 { ^selfns.Donkey } // should return same as MyObject.System.Donkey
|
2017-06-07 17:22:14 +00:00
|
|
|
method(#class) donkey3 { ^MyObject.Donkey }
|
|
|
|
|
|
|
|
method(#class) horse1 { ^Horse }
|
|
|
|
method(#class) horse2 { ^selfns.Horse }
|
|
|
|
}
|
2016-03-28 13:27:03 +00:00
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
pooldic XX
|
|
|
|
{
|
2019-09-30 08:46:50 +00:00
|
|
|
Horse := MyObject.System.Horse,
|
|
|
|
Party := MyObject.Donkey.Party,
|
|
|
|
AAAA := 'AAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
|
|
FFFF := 'FFFFFFFFFFFFFFFFFFFFFFFFF'
|
2017-06-07 17:22:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class MyObject.System.System (selfns.Donkey)
|
|
|
|
{
|
|
|
|
var(#classinst,#get,#set) a, b, c.
|
|
|
|
var(#get) ii := 0, jj := 0.
|
|
|
|
}
|
|
|
|
class MyObject.System.System.System (MyObject.System.System)
|
|
|
|
{
|
|
|
|
var(#classinst,#get) d, dd, ddd.
|
|
|
|
var(#class,#get) KING := #KING.
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyObject.System.System.System.System (MyObject.System.System.System)
|
|
|
|
{
|
|
|
|
var(#classinst,#get) e, f := XX.FFFF.
|
|
|
|
var(#get) kk := #KK.
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyObject.System.Stallion (selfns.Donkey)
|
|
|
|
{
|
|
|
|
import System.XX.
|
|
|
|
|
|
|
|
var(#set,#get) x := MyObject.Code.FASTER3X, rvd.
|
|
|
|
var yyy.
|
|
|
|
var(#set,#get) zebra, qatar := MyObject.Code.FASTER2X.
|
2019-04-03 19:19:09 +00:00
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
|
|
|
|
method(#class) party { ^Party }
|
2019-06-27 06:29:09 +00:00
|
|
|
method(#class) system1 { ^System } // Single word. can be looked up in the current workspace.
|
|
|
|
method(#class) system2 { ^System.System } // Dotted. The search begins at the top.
|
2017-06-07 17:22:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extend MyObject
|
|
|
|
{
|
2019-06-27 06:29:09 +00:00
|
|
|
// TODO: support import in extend??
|
2016-03-28 13:27:03 +00:00
|
|
|
|
2017-09-21 07:56:51 +00:00
|
|
|
method(#class) makeBlock(a,b)
|
|
|
|
{
|
|
|
|
^[:x | a * x + b]
|
|
|
|
}
|
|
|
|
|
|
|
|
method(#class) testMakeBlock
|
|
|
|
{
|
|
|
|
|a b |
|
|
|
|
a := self makeBlock (12, 22).
|
|
|
|
b := self makeBlock (99, 4).
|
2019-06-27 06:29:09 +00:00
|
|
|
^(a value: 5) * (b value: 6). // (12 * 5 + 22) * (99 * 6 + 4) => 49036
|
2017-09-21 07:56:51 +00:00
|
|
|
}
|
|
|
|
|
2019-04-06 05:06:11 +00:00
|
|
|
method(#class) testBigintDiv: divd_base divisor: divr_base count: count
|
2019-04-03 19:19:09 +00:00
|
|
|
{
|
2019-04-06 05:06:11 +00:00
|
|
|
| i q r divd divr ubound |
|
2019-04-03 19:19:09 +00:00
|
|
|
|
|
|
|
i := 1.
|
2019-04-06 05:06:11 +00:00
|
|
|
ubound := i + count.
|
|
|
|
while (i < ubound)
|
2019-04-03 19:19:09 +00:00
|
|
|
{
|
2019-04-04 09:30:24 +00:00
|
|
|
divd := divd_base * i.
|
|
|
|
divr := divr_base * i.
|
|
|
|
q := divd div: divr.
|
|
|
|
r := divd rem: divr.
|
|
|
|
if (divd ~= (q * divr + r)) { i dump. divd dump. divr dump. q dump. r dump. (q * divr + r) dump. ^false. }.
|
|
|
|
|
|
|
|
divd := divd_base * i.
|
|
|
|
divr := divr_base.
|
|
|
|
q := divd div: divr.
|
|
|
|
r := divd rem: divr.
|
2019-04-03 19:19:09 +00:00
|
|
|
|
2019-04-04 09:30:24 +00:00
|
|
|
if (divd ~= (q * divr + r)) { i dump. divd dump. divr dump. q dump. r dump. (q * divr + r) dump. ^false. }.
|
|
|
|
|
|
|
|
divd := divd_base.
|
|
|
|
divr := divr_base * i.
|
2019-04-03 19:19:09 +00:00
|
|
|
q := divd div: divr.
|
|
|
|
r := divd rem: divr.
|
2019-04-04 09:30:24 +00:00
|
|
|
if (divd ~= (q * divr + r)) { i dump. divd dump. divr dump. q dump. r dump. (q * divr + r) dump. ^false. }.
|
2019-04-03 19:19:09 +00:00
|
|
|
|
2019-04-04 09:30:24 +00:00
|
|
|
divd := divd_base * i * i.
|
|
|
|
divr := divr_base * i.
|
|
|
|
q := divd div: divr.
|
|
|
|
r := divd rem: divr.
|
|
|
|
if (divd ~= (q * divr + r)) { i dump. divd dump. divr dump. q dump. r dump. (q * divr + r) dump. ^false. }.
|
2019-04-03 19:19:09 +00:00
|
|
|
|
|
|
|
i := i + 1.
|
|
|
|
}.
|
|
|
|
^true
|
|
|
|
}
|
|
|
|
|
2017-01-06 09:53:40 +00:00
|
|
|
method(#class) main
|
2016-03-28 13:27:03 +00:00
|
|
|
{
|
2017-06-07 17:22:14 +00:00
|
|
|
| tc limit |
|
|
|
|
|
2019-06-27 07:43:17 +00:00
|
|
|
tc := ##(
|
2019-06-27 06:29:09 +00:00
|
|
|
// 0 - 4
|
2017-06-07 17:22:14 +00:00
|
|
|
[MyObject.Donkey v == 901982],
|
|
|
|
[selfns.MyObject.Donkey v == 901982],
|
|
|
|
[MyObject.System.Donkey v == 89123],
|
|
|
|
[MyObject.System.Horse v == 89123],
|
|
|
|
[selfns.MyObject.System.Donkey v == 89123],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 5 - 9
|
2017-06-07 17:22:14 +00:00
|
|
|
[MyObject.System.Horse donkey1 == MyObject.System.Donkey],
|
|
|
|
[MyObject.System.Horse donkey2 == MyObject.System.Donkey],
|
|
|
|
[MyObject.System.Horse donkey2 v == 89123],
|
|
|
|
[MyObject.System.Horse donkey3 v == 901982],
|
|
|
|
[MyObject.System.Horse horse1 == MyObject.System.Horse],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 10 - 14
|
2017-06-07 17:22:14 +00:00
|
|
|
[MyObject.System.Horse horse2 == MyObject.System.Horse],
|
|
|
|
[MyObject.System.Horse superclass == MyObject.System.Donkey],
|
|
|
|
[MyObject.System.Donkey superclass == MyObject],
|
|
|
|
[selfns == System nsdic],
|
|
|
|
[MyObject.System.Horse myns1 == MyObject.System],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 15 - 19
|
2017-06-07 17:22:14 +00:00
|
|
|
[MyObject.System.Horse myns2 == MyObject.System],
|
|
|
|
[MyObject.System == self.System],
|
|
|
|
[MyObject.System.Donkey == self.System.Donkey],
|
|
|
|
[MyObject.System.Stallion superclass == self.System.Donkey],
|
|
|
|
[MyObject.Donkey.Party party1 == 5555],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 20 - 24
|
2017-06-07 17:22:14 +00:00
|
|
|
[MyObject.Donkey.Party party2 == MyObject.Donkey.Party],
|
|
|
|
[MyObject.Donkey.Party party3 == 5555],
|
|
|
|
[MyObject.Donkey.Party party4 == MyObject.Donkey.Party.Party],
|
|
|
|
[MyObject.Donkey.Party cat1 == MyObject],
|
|
|
|
[MyObject.Code.FASTER2X == 40],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 25 - 29
|
2017-06-07 17:22:14 +00:00
|
|
|
[MyObject.Code.FASTER2X == MyObject.Code.FASTER],
|
|
|
|
[((MyObject.Code.FASTER3X at: 3) at: 1) == MyObject.Donkey],
|
|
|
|
[MyObject.System.Stallion new x == MyObject.Code.FASTER3X],
|
|
|
|
[MyObject.System.Stallion party == MyObject.Donkey.Party],
|
|
|
|
[MyObject.System.Stallion system1 == MyObject.System.System],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 30 - 34
|
2017-06-07 17:22:14 +00:00
|
|
|
[MyObject.System.Stallion system2 == System.System],
|
|
|
|
[MyObject.System.System.System.System f == XX.FFFF],
|
|
|
|
[MyObject.System.System a == XX.AAAA],
|
|
|
|
[MyObject.System.System.System.System a == nil] ,
|
|
|
|
[MyObject.System.System.System.System new kk == #KK],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 35 - 39
|
2017-09-21 07:56:51 +00:00
|
|
|
[MyObject.System.System.System KING == #KING],
|
2018-12-21 16:58:58 +00:00
|
|
|
[self testMakeBlock == 49036],
|
|
|
|
[ ((-2305843009213693952 * -2305843009213693952 * 2305843009213693952 * 2305843009213693952 * 2305843009213693952) - 1 + 2) = 65185151242703554760590262029100101153646988597309960020356494379340201592426774597868716033 ],
|
|
|
|
[ "%d" strfmt((-2305843009213693952 * -2305843009213693952 * 2305843009213693952 * 2305843009213693952 * 2305843009213693952) - 1 + 2) = '65185151242703554760590262029100101153646988597309960020356494379340201592426774597868716033' ],
|
|
|
|
[ "%#b" strfmt((-2305843009213693952 * -2305843009213693952 * 2305843009213693952 * 2305843009213693952 * 2305843009213693952) - 1 + 2) = '2r100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001' ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 40 - 44
|
2018-12-23 16:44:47 +00:00
|
|
|
[ "%#x" strfmt((-2305843009213693952 * -2305843009213693952 * 2305843009213693952 * 2305843009213693952 * 2305843009213693952) - 1 + 2) = '16r20000000000000000000000000000000000000000000000000000000000000000000000000001' ],
|
|
|
|
[ (7 div: -3) = -2 ],
|
|
|
|
[ (7 rem: -3) = 1 ],
|
|
|
|
[ (7 mdiv: -3) = -3 ],
|
|
|
|
[ (7 mod: -3) = -2 ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 45-49
|
2018-12-23 16:44:47 +00:00
|
|
|
[ ([ (7 div: 0) = -2 ] on: Exception do: [:ex | ex messageText ]) = 'divide by zero' ],
|
|
|
|
[ ([ (7 rem: 0) = -2 ] on: Exception do: [:ex | ex messageText ]) = 'divide by zero' ],
|
|
|
|
[ ([ (7 mdiv: 0) = -2 ] on: Exception do: [:ex | ex messageText ]) = 'divide by zero' ],
|
|
|
|
[ ([ (7 mod: 0) = -2 ] on: Exception do: [:ex | ex messageText ]) = 'divide by zero' ],
|
|
|
|
[ (270000000000000000000000000000000000000000000000000000000000000000000 div: 50000000000000000000000000000000000000000000000000000000000000000000) = 5 ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 50-54
|
2018-12-23 16:44:47 +00:00
|
|
|
[ (270000000000000000000000000000000000000000000000000000000000000000000 rem: 50000000000000000000000000000000000000000000000000000000000000000000) = 20000000000000000000000000000000000000000000000000000000000000000000 ],
|
|
|
|
[ (270000000000000000000000000000000000000000000000000000000000000000000 mdiv: 50000000000000000000000000000000000000000000000000000000000000000000) = 5],
|
|
|
|
[ (270000000000000000000000000000000000000000000000000000000000000000000 mod: 50000000000000000000000000000000000000000000000000000000000000000000) = 20000000000000000000000000000000000000000000000000000000000000000000 ],
|
|
|
|
[ (0 rem: -50000000000000000000000000000000000000000000000000000000000000000000) = 0 ],
|
|
|
|
[ (0 rem: -50000000000000000000000000000000000000000000000000000000000000000000) = 0 ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 55-59
|
2018-12-23 16:44:47 +00:00
|
|
|
[ (0 rem: -50000000000000000000000000000000000000000000000000000000000000000000) = 0 ],
|
|
|
|
[ (0 rem: -50000000000000000000000000000000000000000000000000000000000000000000) = 0 ],
|
|
|
|
[ (16r2dd01fc06c265c8163ac729b49d890939826ce3dd div: 16r3b9aca00) = 4184734490355220618401938634485367707982 ],
|
|
|
|
[ (16r2dd01fc06c265c8163ac729b49d890939826ce3dd rem: 16r3b9aca00) = 394876893 ],
|
2019-01-04 16:01:55 +00:00
|
|
|
[ (16rFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF bitAnd: 16r1111111111111111111111111111111111111111) = 16r1111111111111111111111111111111111111111 ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 60-64
|
2019-02-20 17:40:34 +00:00
|
|
|
[(100213123891273912837891273189237 div: 1238971238971894573289472398477891263781263781263) = 0],
|
|
|
|
[(100213123891273912837891273189237 rem: 1238971238971894573289472398477891263781263781263) = 100213123891273912837891273189237],
|
|
|
|
[(-100213123891273912837891273189237 div: 1238971238971894573289472398477891263781263781263) = 0],
|
|
|
|
[(-100213123891273912837891273189237 rem: 1238971238971894573289472398477891263781263781263) = -100213123891273912837891273189237],
|
|
|
|
[(-100213123891273912837891273189237 mdiv: 1238971238971894573289472398477891263781263781263) = -1],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 65-69
|
2019-02-20 17:40:34 +00:00
|
|
|
[(-100213123891273912837891273189237 mod: 1238971238971894573289472398477891263781263781263) = 1238971238971894473076348507203978425889990592026],
|
|
|
|
[(-123897123897189421321312312321312312132 div: -123897123897189421321312312321312312132) = 1],
|
|
|
|
[(-123897123897189421321312312321312312132 rem: -123897123897189421321312312321312312132) = 0],
|
|
|
|
[(-123897123897189421321312312321312312132 mdiv: -123897123897189421321312312321312312132) = 1],
|
|
|
|
[(-123897123897189421321312312321312312132 mod: -123897123897189421321312312321312312132) = 0],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 70-74
|
2019-01-10 15:22:43 +00:00
|
|
|
[ (-0.1233 * 999999.123) = -123299.8918 ],
|
|
|
|
[ (-0.1233 * 999999.123) asString = '-123299.8918' ],
|
|
|
|
[ (-0.1233 - -0.123) = -0.0003 ],
|
|
|
|
[ (-0.1233 - -0.123) asString = '-0.0003' ],
|
2019-06-27 06:29:09 +00:00
|
|
|
[ (1.234 - 1.234) = 0 ], // 0.000
|
2019-01-10 15:22:43 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 75-79
|
2019-01-10 15:28:37 +00:00
|
|
|
[ (10.12 * 20.345) = 205.891 ],
|
|
|
|
[ (10.12 mlt: 20.345) = 205.89 ],
|
2019-01-10 15:22:43 +00:00
|
|
|
[ (-123897128378912738912738917.112323131233 div: 123.1) = -1006475453931053931053931.089458352000 ],
|
|
|
|
[ (-1006475453931053931053931.089458352000 * 123.1) = -123897128378912738912738917.112323131200 ],
|
2019-02-18 08:57:59 +00:00
|
|
|
[ 10 scale = 0 ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 80-84
|
2019-02-18 08:57:59 +00:00
|
|
|
[ 10.0 scale = 1 ],
|
|
|
|
[ 10.00 scale = 2 ],
|
|
|
|
[ (10 scale: 1) = 10.0 ],
|
|
|
|
[ (10 scale: 1) scale = (10.1 scale) ],
|
|
|
|
[ (10 scale: 2) scale = (10.11 scale) ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 85-89
|
2019-02-18 17:13:33 +00:00
|
|
|
[ ((-10.19 scale: 3) scale) = (10.199 scale) ],
|
|
|
|
[ ((-10.19 scale: 0) scale) = (10 scale) ],
|
|
|
|
[ (-9p10 scale) = (-10.000000000 scale) ],
|
|
|
|
[ (-9p10.123 scale) = (-10.123000000 scale) ],
|
2019-02-19 05:02:37 +00:00
|
|
|
[ (+3p100.1 + 16rffff + +5p1.22 + -5p1.223) = 65635.09700 ],
|
2019-01-10 15:22:43 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 90-94
|
2019-02-21 03:49:31 +00:00
|
|
|
[ (30p2123.12 asString) = '2123.120000000000000000000000000000' ],
|
|
|
|
[ (+30p2123.12 asString) = '2123.120000000000000000000000000000' ],
|
|
|
|
[ (-30p2123.12 asString) = '-2123.120000000000000000000000000000' ],
|
2019-03-24 18:49:16 +00:00
|
|
|
[ (811306333091350399588761 div: 16) = 50706645818209399974297 ],
|
2019-03-25 13:00:15 +00:00
|
|
|
[ (811306333091350399588761 mdiv: 16) = 50706645818209399974297 ],
|
|
|
|
|
2019-03-24 18:49:16 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 95-99
|
2019-03-25 13:00:15 +00:00
|
|
|
[ (811306333091350399588761 rem: 16) = 9 ],
|
2019-03-24 18:49:16 +00:00
|
|
|
[ (811306333091350399588761 mod: 16) = 9 ],
|
|
|
|
[ (811306333091350399588761 div: 128) = 6338330727276174996787 ],
|
2019-03-25 13:00:15 +00:00
|
|
|
[ (811306333091350399588761 mdiv: 128) = 6338330727276174996787 ],
|
2019-03-24 18:49:16 +00:00
|
|
|
[ (811306333091350399588761 rem: 128) = 25 ],
|
2019-03-25 11:41:26 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 100-104
|
2019-03-25 13:00:15 +00:00
|
|
|
[ (811306333091350399588761 mod: 128) = 25 ],
|
|
|
|
[ (-811306333091350399588761 div: -16) = 50706645818209399974297 ],
|
|
|
|
[ (-811306333091350399588761 mdiv: -16) = 50706645818209399974297 ],
|
2019-03-25 11:41:26 +00:00
|
|
|
[ (-811306333091350399588761 rem: -16) = -9 ],
|
|
|
|
[ (-811306333091350399588761 mod: -16) = -9 ],
|
2019-03-25 13:00:15 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 105-109
|
2019-03-25 11:41:26 +00:00
|
|
|
[ (-811306333091350399588761 div: -128) = 6338330727276174996787 ],
|
2019-03-25 13:00:15 +00:00
|
|
|
[ (-811306333091350399588761 mdiv: -128) = 6338330727276174996787 ],
|
2019-03-25 11:41:26 +00:00
|
|
|
[ (-811306333091350399588761 rem: -128) = -25 ],
|
|
|
|
[ (-811306333091350399588761 mod: -128) = -25 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 div: -1024) = 7922913409095218745983995988652160870400128212219627901 ],
|
2019-03-25 13:00:15 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 110-114
|
2019-03-25 13:00:15 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mdiv: -1024) = 7922913409095218745983995988652160870400128212219627901 ],
|
2019-03-25 11:41:26 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 rem: -1024) = -607 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mod: -1024) = -607 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 div: -65535) = 123797411015693964994088836383303772507663558240831600 ],
|
2019-03-25 13:00:15 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mdiv: -65535) = 123797411015693964994088836383303772507663558240831600 ],
|
2019-03-25 11:41:26 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 115-119
|
2019-03-25 13:00:15 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 rem: -65535) = -65231 ],
|
2019-03-25 11:41:26 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mod: -65535) = -65231 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 div: -65536) = 123795522017112792905999937322690013600002003315931685 ],
|
2019-03-25 13:00:15 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mdiv: -65536) = 123795522017112792905999937322690013600002003315931685 ],
|
2019-03-25 11:41:26 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 rem: -65536) = -63071 ],
|
2019-03-25 13:00:15 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 120-124
|
2019-03-25 11:41:26 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mod: -65536) = -63071 ],
|
2019-03-25 13:00:15 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 div: 65535) = -123797411015693964994088836383303772507663558240831600 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mdiv: 65535) = -123797411015693964994088836383303772507663558240831601 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 rem: 65535) = -65231 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mod: 65535) = 304 ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 125-129
|
2019-03-30 13:43:10 +00:00
|
|
|
[ (65535 div: -8113063330913503995887611892379812731289731289312898971231) = 0 ],
|
|
|
|
[ (65535 mdiv: -8113063330913503995887611892379812731289731289312898971231) = -1 ],
|
|
|
|
[ (65535 rem: -8113063330913503995887611892379812731289731289312898971231) = 65535 ],
|
|
|
|
[ (65535 mod: -8113063330913503995887611892379812731289731289312898971231) = -8113063330913503995887611892379812731289731289312898905696 ],
|
|
|
|
[ (-65535 div: -8113063330913503995887611892379812731289731289312898971231) = 0 ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 130-134
|
2019-03-30 13:43:10 +00:00
|
|
|
[ (-65535 mdiv: -8113063330913503995887611892379812731289731289312898971231) = 0 ],
|
|
|
|
[ (-65535 rem: -8113063330913503995887611892379812731289731289312898971231) = -65535],
|
|
|
|
[ (-65535 mod: -8113063330913503995887611892379812731289731289312898971231) = -65535 ],
|
|
|
|
[ (-65535 div: 8113063330913503995887611892379812731289731289312898971231) = 0 ],
|
|
|
|
[ (-65535 mdiv: 8113063330913503995887611892379812731289731289312898971231) = -1 ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 135-139
|
2019-03-30 13:43:10 +00:00
|
|
|
[ (-65535 rem: 8113063330913503995887611892379812731289731289312898971231) = -65535 ],
|
|
|
|
[ (-65535 mod: 8113063330913503995887611892379812731289731289312898971231) = 8113063330913503995887611892379812731289731289312898905696 ],
|
2019-04-01 08:45:21 +00:00
|
|
|
[ (8113063330913503995887611892379812731289731289312898971231 div: 34359738368) = 236121219667649827777862429280643489074710852271 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 div: 34359738368) = -236121219667649827777862429280643489074710852271 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mdiv: 34359738368) = -236121219667649827777862429280643489074710852272 ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 140-144
|
2019-04-01 08:45:21 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 rem: 34359738368) = -31040337503 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mod: 34359738368) = 3319400865 ],
|
2019-04-03 19:19:09 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 div: 18446744073709551615) = -439810044444445199874532569660475732947 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mdiv: 18446744073709551615) = -439810044444445199874532569660475732948 ],
|
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 rem: 18446744073709551615) = -16637658201046411826 ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 145-149
|
2019-04-03 19:19:09 +00:00
|
|
|
[ (-8113063330913503995887611892379812731289731289312898971231 mod: 18446744073709551615) = 1809085872663139789 ],
|
|
|
|
[ (8113063330913503995887611892379812731289731289312898971231 div: 8113063330913503995887611892379812731289731289312898971231) = 1 ],
|
|
|
|
[ (8113063330913503995887611892379812731289731289312898971231 rem: 8113063330913503995887611892379812731289731289312898971231) = 0 ],
|
|
|
|
[ (8113063330913503995887611892379812731289731289312898971231 div: 8113063330913503995887611892379812731289731289312898971232) = 0 ],
|
|
|
|
[ (8113063330913503995887611892379812731289731289312898971231 rem: 8113063330913503995887611892379812731289731289312898971232) = 8113063330913503995887611892379812731289731289312898971231 ],
|
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 150-154
|
2019-04-03 19:19:09 +00:00
|
|
|
[ (8113063330913503995887611892379812731289731289312898971231 div: 8113063330913503995887611892379812731289731289312898971230) = 1 ],
|
|
|
|
[ (8113063330913503995887611892379812731289731289312898971231 rem: 8113063330913503995887611892379812731289731289312898971230) = 1 ],
|
2019-04-06 05:06:11 +00:00
|
|
|
[ self testBigintDiv: 100919283908998345873248972389472389791283789123712899089034258903482398198123912831 divisor: 129323482374892374238974238974238947328972389128387312892713891728391278 count: 2000 ],
|
|
|
|
[ self testBigintDiv: 234897230919283908998345873248972389472389791283789123712899089034258903482398198123912831 divisor: 12932348237489237423897423897423894732897238912838731289271389172839127 count: 2000 ],
|
|
|
|
[ self testBigintDiv: 16r1234567812345678123456781234567812345678123456781234567812345678123456781234567812345678 divisor: 16r12345678123456781234567812345678123456781234567812345678 count: 2000 ],
|
2019-04-08 09:10:02 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 155-159
|
2019-04-06 05:06:11 +00:00
|
|
|
[ self testBigintDiv: 16r000089ab0000456700000123 divisor: 1 count: 2000 ],
|
|
|
|
[ self testBigintDiv: 16r000000030000000000008000 divisor: 16r000000010000000000002000 count: 2000 ],
|
|
|
|
[ self testBigintDiv: 16rfffffffe0000000080000000 divisor: 16r0000ffff0000000080000000 count: 12345 ],
|
|
|
|
[ self testBigintDiv: 16rfffffffffffffffe divisor: 16rffffffff count: 2000 ],
|
2019-04-08 01:18:00 +00:00
|
|
|
[ self testBigintDiv: 68651967526299315528548877601614136727014 divisor: 1729382256910270380 count: 1 ],
|
2019-04-08 09:10:02 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// 160-164
|
2019-04-08 04:14:37 +00:00
|
|
|
[ self testBigintDiv: 43943618413704592900396132847030223073729048496 divisor: 1135814937804493543741046072006331 count: 1 ],
|
2019-04-08 05:36:58 +00:00
|
|
|
[ self testBigintDiv: 76733673740671314025981152630586699414203 divisor: 12682136550675277273 count: 1 ],
|
2019-04-08 09:10:02 +00:00
|
|
|
[ self testBigintDiv: 265804060782114895959697138188904455994 divisor: 713053462628379038341886861235 count: 1],
|
2019-04-03 19:19:09 +00:00
|
|
|
|
2019-06-27 06:29:09 +00:00
|
|
|
// =========================
|
2019-02-21 03:49:31 +00:00
|
|
|
[
|
|
|
|
| k |
|
|
|
|
k := String new.
|
2019-06-27 07:43:17 +00:00
|
|
|
(##( 1 + 2, -21391239218392 * +291382913821, 19p10 div: 3 ) asOrderedCollection) doWithIndex: [:each :index | k := k & (index asString) & '=>' & (each asString) & ' '. ].
|
2019-02-21 03:49:31 +00:00
|
|
|
k = '0=>3 1=>-6233041613697111534195832 2=>3.3333333333333333333 '.
|
|
|
|
],
|
|
|
|
|
2019-02-21 08:23:43 +00:00
|
|
|
|
|
|
|
[
|
|
|
|
| k |
|
|
|
|
k := #('str1' 'str2' 'str3' 'str4' 'str5' 'str1' 'str2') asSet.
|
2019-06-27 06:29:09 +00:00
|
|
|
//k do: [:each | each dump].
|
2019-02-21 08:23:43 +00:00
|
|
|
if ((k includes: 'str1') and (k includes: 'str3') and ((k includes: 'str9') not)) { true } else { false }
|
|
|
|
],
|
2019-01-04 16:01:55 +00:00
|
|
|
[
|
|
|
|
| b |
|
|
|
|
b := [:n | (n > 0) ifTrue: [ n * (b value: n - 1)] ifFalse: [1]].
|
|
|
|
(b value: 3) == 6
|
|
|
|
],
|
|
|
|
[
|
|
|
|
| b |
|
|
|
|
b := [:n | (n > 0) ifTrue: [ (b value: n - 1) * n] ifFalse: [1]].
|
|
|
|
(b value: 3) == 6
|
|
|
|
]
|
2017-06-16 09:45:22 +00:00
|
|
|
).
|
2016-03-28 13:27:03 +00:00
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
limit := tc size.
|
|
|
|
MyObject.System.System a: XX.AAAA.
|
|
|
|
|
|
|
|
0 priorTo: limit by: 1 do: [ :idx |
|
|
|
|
| tb |
|
|
|
|
tb := tc at: idx.
|
2019-06-27 08:06:33 +00:00
|
|
|
System log(System.Log.INFO, idx asString, (if (tb value) { " PASS" } else { " FAIL" }), "\n").
|
2018-12-21 16:58:58 +00:00
|
|
|
].
|
2020-10-15 14:50:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
[ 10 dump. [20 dump] value; value; ] value; value.
|
|
|
|
|
2017-06-07 17:22:14 +00:00
|
|
|
}
|
2016-03-28 13:27:03 +00:00
|
|
|
}
|