RegressionTests__IntegerTest.st
author Claus Gittinger <cg@exept.de>
Tue, 25 Feb 2020 17:19:46 +0100
changeset 2585 f93664a7393a
parent 2500 5fb412ae3c50
permissions -rw-r--r--
s
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1521
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
     1
"{ Package: 'stx:goodies/regression' }"
56
77f5ad522f18 category
Claus Gittinger <cg@exept.de>
parents: 54
diff changeset
     2
70
c677f96c4a0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 69
diff changeset
     3
"{ NameSpace: RegressionTests }"
c677f96c4a0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 69
diff changeset
     4
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
     5
TestCase subclass:#IntegerTest
1318
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
     6
	instanceVariableNames:''
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
     7
	classVariableNames:''
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
     8
	poolDictionaries:''
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
     9
	category:'tests-Regression-Numbers'
2
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    13
!IntegerTest methodsFor:'helpers'!
4
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
    14
1527
6865b3c44b02 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
    15
do:a plus:b
6865b3c44b02 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
    16
    ^  a + b
6865b3c44b02 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
    17
!
6865b3c44b02 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
    18
1521
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    19
doAdd2_a:arg
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    20
    ^ arg + 2
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    21
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    22
    "
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    23
     (self new doAdd2_a:0) ==   2    
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    24
     (self new doAdd2_a:1) ==   3    
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    25
     (self new doAdd2_a:SmallInteger maxVal) = (SmallInteger maxVal + 2)  
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    26
     (self new doAdd2_a:SmallInteger minVal) = (SmallInteger minVal + 2)
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    27
    "
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    28
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    29
    "Modified: / 9.6.1999 / 16:57:20 / cg"
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    30
!
52ffd99b102b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    31
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    32
doCompare:a againstEqual:b
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    33
    self assert:(a < b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    34
    self assert:(a <= b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    35
    self assert:(a = b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    36
    self assert:(a ~= b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    37
    self assert:(a > b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    38
    self assert:(a >= b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    39
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    40
    self assert:(a perform:#<   with:b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    41
    self assert:(a perform:#<=  with:b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    42
    self assert:(a perform:#=   with:b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    43
    self assert:(a perform:#~=  with:b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    44
    self assert:(a perform:#>   with:b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    45
    self assert:(a perform:#>=  with:b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    46
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    47
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    48
     self basicNew doCompare:12 againstEqual:12
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    49
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    50
!
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    51
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    52
doCompare:a againstGreater:b
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    53
    self assert:(a < b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    54
    self assert:(a <= b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    55
    self assert:(a = b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    56
    self assert:(a ~= b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    57
    self assert:(a == b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    58
    self assert:(a ~~ b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    59
    self assert:(a > b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    60
    self assert:(a >= b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    61
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    62
    self assert:(a perform:#<   with:b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    63
    self assert:(a perform:#<=  with:b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    64
    self assert:(a perform:#=   with:b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    65
    self assert:(a perform:#~=  with:b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    66
    self assert:(a perform:#==  with:b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    67
    self assert:(a perform:#~~  with:b).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    68
    self assert:(a perform:#>   with:b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    69
    self assert:(a perform:#>=  with:b) not.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    70
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    71
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    72
     self basicNew doCompare:12 againstGreater:16r80000000
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    73
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    74
!
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
    75
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
    76
doMul0_a:arg
31
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    77
    ^ arg * 0
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    78
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    79
    "
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
    80
     (self doMul0_a:0) ==   0
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
    81
     (self doMul0_a:1) ==   0
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
    82
     (self doMul0_a:SmallInteger maxVal) == 0
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
    83
     (self doMul0_a:SmallInteger minVal) == 0
31
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    84
    "
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    85
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    86
    "Created: / 9.6.1999 / 15:50:48 / cg"
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    87
!
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    88
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
    89
doMul1_a:arg
31
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    90
    ^ arg * 1
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    91
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    92
    "
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
    93
     (self doMul1_a:0) ==   0
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
    94
     (self doMul1_a:1) ==   1
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
    95
     (self doMul1_a:SmallInteger maxVal) == SmallInteger maxVal
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
    96
     (self doMul1_a:SmallInteger minVal) == SmallInteger minVal
31
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    97
    "
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    98
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
    99
    "Created: / 9.6.1999 / 15:49:09 / cg"
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
   100
!
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
   101
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   102
doMul2_a:arg
32
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   103
    ^ arg * 2
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   104
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   105
    "
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   106
     (self doMul2_a:0) ==   0
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   107
     (self doMul2_a:1) ==   2
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   108
     (self doMul2_a:SmallInteger maxVal) = (SmallInteger maxVal + SmallInteger maxVal)
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   109
     (self doMul2_a:SmallInteger minVal) = (SmallInteger minVal + SmallInteger minVal)
32
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   110
    "
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   111
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   112
    "Modified: / 9.6.1999 / 16:57:20 / cg"
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   113
!
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   114
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   115
doMul3_a:arg
32
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   116
    ^ arg * 3
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   117
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   118
    "
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   119
     (self doMul3_a:0) ==   0
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   120
     (self doMul3_a:1) ==   3
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   121
     (self doMul3_a:-1) ==  -3
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   122
     (self doMul3_a:10000) ==   30000
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   123
     (self doMul3_a:SmallInteger maxVal) = (SmallInteger maxVal + SmallInteger maxVal + SmallInteger maxVal)
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   124
     (self doMul3_a:SmallInteger minVal) = (SmallInteger minVal + SmallInteger minVal + SmallInteger minVal)
32
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   125
    "
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   126
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   127
    "Created: / 9.6.1999 / 16:57:47 / cg"
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   128
    "Modified: / 9.6.1999 / 17:35:34 / cg"
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   129
!
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   130
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   131
doMul4_a:arg
32
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   132
    ^ arg * 4
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   133
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   134
    "
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   135
     (self doMul4_a:0) ==   0
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   136
     (self doMul4_a:1) ==   4
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   137
     (self doMul4_a:-1) ==  -4
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   138
     (self doMul4_a:10000) ==   40000
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   139
     (self doMul4_a:SmallInteger maxVal//4) == 4611686018427387900
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   140
     (self doMul4_a:SmallInteger maxVal//4+1) = 4611686018427387904
32
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   141
    "
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   142
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   143
    "Created: / 9.6.1999 / 16:57:47 / cg"
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   144
    "Modified: / 9.6.1999 / 17:37:36 / cg"
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   145
!
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   146
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   147
doMul5_a:arg
32
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   148
    ^ arg * 5
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   149
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   150
    "
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   151
     (self doMul5_a:0) ==   0
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   152
     (self doMul5_a:1) ==   5
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   153
     (self doMul5_a:-1) ==  -5
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   154
     (self doMul5_a:10000) ==   50000
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   155
     (self doMul5_a:SmallInteger maxVal//5) == 4611686018427387900
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   156
     (self doMul5_a:SmallInteger maxVal//4+1) = 4611686018427387905
32
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   157
    "
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   158
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   159
    "Created: / 9.6.1999 / 17:38:17 / cg"
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   160
!
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   161
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   162
doMulM1_a:arg
31
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
   163
    ^ arg * -1
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
   164
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
   165
    "
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   166
     (self doMulM1_a:0) ==   0
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   167
     (self doMulM1_a:1) ==   -1
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   168
     (self doMulM1_a:SmallInteger maxVal) == (SmallInteger minVal + 1)
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   169
     (self doMulM1_a:SmallInteger minVal) = (SmallInteger maxVal + 1)
31
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
   170
    "
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
   171
32
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
   172
    "Modified: / 9.6.1999 / 16:54:02 / cg"
31
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
   173
!
4738d31a625e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 29
diff changeset
   174
1833
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   175
doNegate2:aNumber
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   176
    |i "{ Class: SmallInteger }"|
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   177
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   178
    i := aNumber.
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   179
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   180
    ^ i negated
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   181
!
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   182
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   183
doNegate:aNumber
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   184
    ^ aNumber negated
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   185
!
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
   186
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   187
doPlus1_a:arg
4
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   188
    ^ arg + 1
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   189
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   190
    "
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   191
     (self doPlus1_a:SmallInteger maxVal) =   1073741824
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   192
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   193
!
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   194
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   195
doPlus1_b:arg
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   196
    ^ arg perform:#+ with:1
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   197
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   198
    "
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   199
     (self doPlus1_b:SmallInteger maxVal) ==   1073741824
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   200
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   201
!
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   202
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   203
testMul0
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   204
    self assert: ( (self doMul0_a:0) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   205
    self assert: ( (self doMul0_a:1) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   206
    self assert: ( (self doMul0_a:SmallInteger maxVal) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   207
    self assert: ( (self doMul0_a:SmallInteger minVal) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   208
    self assert: ( (self doMul0_a:SmallInteger maxVal+1) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   209
    self assert: ( (self doMul0_a:SmallInteger minVal-1) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   210
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   211
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   212
     self basicNew testMul0
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   213
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   214
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   215
    "Created: / 9.6.1999 / 15:50:48 / cg"
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   216
!
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   217
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   218
testMul1
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   219
    self assert: ( (self doMul1_a:0) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   220
    self assert: ( (self doMul1_a:1) == 1 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   221
    self assert: ( (self doMul1_a:SmallInteger maxVal) == SmallInteger maxVal ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   222
    self assert: ( (self doMul1_a:SmallInteger minVal) == SmallInteger minVal ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   223
    self assert: ( (self doMul1_a:SmallInteger maxVal+1) = (SmallInteger maxVal+1) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   224
    self assert: ( (self doMul1_a:SmallInteger minVal-1) = (SmallInteger minVal-1) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   225
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   226
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   227
     self basicNew testMul1
4
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   228
    "
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   229
!
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   230
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   231
testMul2
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   232
    self assert: ( (self doMul2_a:0) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   233
    self assert: ( (self doMul2_a:1) == 2 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   234
    self assert: ( (self doMul2_a:SmallInteger maxVal) = (SmallInteger maxVal + SmallInteger maxVal) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   235
    self assert: ( (self doMul2_a:SmallInteger minVal) = (SmallInteger minVal + SmallInteger minVal) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   236
    self assert: ( (self doMul2_a:SmallInteger maxVal+1) = ((SmallInteger maxVal+1)+(SmallInteger maxVal+1)) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   237
    self assert: ( (self doMul2_a:SmallInteger minVal-1) = ((SmallInteger minVal-1)+(SmallInteger minVal-1)) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   238
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   239
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   240
     self basicNew testMul2
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   241
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   242
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   243
    "Modified: / 9.6.1999 / 16:57:20 / cg"
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   244
!
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   245
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   246
testMul3
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   247
    self assert: ( (self doMul3_a:0) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   248
    self assert: ( (self doMul3_a:1) == 3 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   249
    self assert: ( (self doMul3_a:-1) == -3 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   250
    self assert: ( (self doMul3_a:10000) == 30000 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   251
    self assert: ( (self doMul3_a:SmallInteger maxVal) = (SmallInteger maxVal + SmallInteger maxVal + SmallInteger maxVal) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   252
    self assert: ( (self doMul3_a:SmallInteger minVal) = (SmallInteger minVal + SmallInteger minVal + SmallInteger minVal) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   253
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   254
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   255
     self basicNew testMul3
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   256
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   257
!
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   258
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   259
testMul4
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   260
    self assert: ( (self doMul4_a:0) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   261
    self assert: ( (self doMul4_a:1) == 4 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   262
    self assert: ( (self doMul4_a:-1) == -4 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   263
    self assert: ( (self doMul4_a:10000) == 40000 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   264
    self assert: ( (self doMul4_a:SmallInteger maxVal) = (SmallInteger maxVal + SmallInteger maxVal + SmallInteger maxVal + SmallInteger maxVal) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   265
    self assert: ( (self doMul4_a:SmallInteger minVal) = (SmallInteger minVal + SmallInteger minVal + SmallInteger minVal + SmallInteger minVal) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   266
    self assert: ( (self doMul4_a:SmallInteger maxVal+1//4) = (SmallInteger maxVal + 1) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   267
    self assert: ( (self doMul4_a:SmallInteger minVal//4) = (SmallInteger minVal) ).
4
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   268
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   269
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   270
     self basicNew testMul4
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   271
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   272
!
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   273
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   274
testMul5
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   275
    self assert: ( (self doMul5_a:0) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   276
    self assert: ( (self doMul5_a:1) == 5 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   277
    self assert: ( (self doMul5_a:-1) == -5 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   278
    self assert: ( (self doMul5_a:10000) == 50000 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   279
    self assert: ( (self doMul5_a:SmallInteger maxVal) = (SmallInteger maxVal + SmallInteger maxVal + SmallInteger maxVal + SmallInteger maxVal + SmallInteger maxVal) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   280
    self assert: ( (self doMul5_a:SmallInteger minVal) = (SmallInteger minVal + SmallInteger minVal + SmallInteger minVal + SmallInteger minVal + SmallInteger minVal) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   281
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   282
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   283
     self basicNew testMul5
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   284
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   285
!
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   286
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   287
testMulM1
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   288
    self assert: ( (self doMulM1_a:0) == 0 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   289
    self assert: ( (self doMulM1_a:1) == -1 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   290
    self assert: ( (self doMulM1_a:-1) == 1 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   291
    self assert: ( (self doMulM1_a:10000) == -10000 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   292
    self assert: ( (self doMulM1_a:SmallInteger maxVal) = (SmallInteger minVal + 1) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   293
    self assert: ( (self doMulM1_a:SmallInteger minVal) = (SmallInteger maxVal + 1) ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   294
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   295
    "
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   296
     self basicNew testMulM1
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   297
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   298
!
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   299
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   300
testPlus1
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   301
    self assert: ( (self doPlus1_a:0) = 1 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   302
    self assert: ( (self doPlus1_a:1) = 2 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   303
    self assert: ( (self doPlus1_a:-1) = 0 ).
934
bf29a53f0eba class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   304
    ExternalAddress pointerSize == 8 ifTrue:[
1318
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   305
	self assert: ( (self doPlus1_a:SmallInteger maxVal) = 4611686018427387904).
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   306
	self assert: ( (self doPlus1_a:SmallInteger minVal) = -4611686018427387903 ).
934
bf29a53f0eba class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   307
    ] ifFalse:[
1318
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   308
	self assert: ( (self doPlus1_a:SmallInteger maxVal) = 1073741824).
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   309
	self assert: ( (self doPlus1_a:SmallInteger minVal) = -1073741823 ).
934
bf29a53f0eba class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   310
    ].
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   311
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   312
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   313
     self basicNew testPlus1
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   314
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   315
!
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   316
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   317
testPlus1perform
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   318
    self assert: ( (self doPlus1_b:0) = 1 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   319
    self assert: ( (self doPlus1_b:1) = 2 ).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   320
    self assert: ( (self doPlus1_b:-1) = 0 ).
934
bf29a53f0eba class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   321
    ExternalAddress pointerSize == 8 ifTrue:[
1318
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   322
	self assert: ( (self doPlus1_b:SmallInteger maxVal) = 4611686018427387904).
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   323
	self assert: ( (self doPlus1_b:SmallInteger minVal) = -4611686018427387903 ).
934
bf29a53f0eba class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   324
    ] ifFalse:[
1318
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   325
	self assert: ( (self doPlus1_b:SmallInteger maxVal) = 1073741824).
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   326
	self assert: ( (self doPlus1_b:SmallInteger minVal) = -1073741823 ).
934
bf29a53f0eba class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   327
    ].
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   328
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   329
    "
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   330
     self basicNew testPlus1perform
4
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   331
    "
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   332
! !
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
   333
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   334
!IntegerTest methodsFor:'private'!
2
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
91
a781d70791b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   336
absPlusOneOf:arg
1318
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   337
			|local1|
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   338
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   339
			local1 := arg.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
   340
			^ local1 abs + 1
91
a781d70791b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   341
a781d70791b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   342
a781d70791b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   343
"
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   344
 self absPlusOneOf:-1
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
   345
 self absPlusOneOf:-1.0
91
a781d70791b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   346
"
a781d70791b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   347
a781d70791b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   348
    "Created: / 31.10.2000 / 20:21:52 / cg"
a781d70791b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   349
!
a781d70791b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   350
89
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   351
alwaysTrue
95
362e58ff28ba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 91
diff changeset
   352
    ^ true.
362e58ff28ba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 91
diff changeset
   353
!
89
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   354
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   355
checkIsInteger:arg
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   356
    ^ arg isInteger
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   357
!
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   358
89
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   359
doConstantIntegerShift
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   360
    "arithmetic tests.
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   361
     Notice, the arithmetic tests are both performed via regular sends
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   362
     and via constructed performs. The reason is to test both inlined
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   363
     JIT-compiler code AND the regular methods code."
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   364
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   365
    |flags|
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   366
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   367
    flags := self flagsSlot.
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   368
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   369
    self alwaysTrue ifFalse:[self halt].
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   370
    ^ flags bitShift:-1.
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   371
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   372
    "
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   373
     self testIntegerShifts3
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   374
    "
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   375
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   376
    "Created: / 6.6.1999 / 14:47:51 / cg"
95
362e58ff28ba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 91
diff changeset
   377
    "Modified: / 9.6.1999 / 17:49:57 / cg"
362e58ff28ba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 91
diff changeset
   378
!
89
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   379
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   380
flagsSlot
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   381
    "arithmetic tests.
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   382
     Notice, the arithmetic tests are both performed via regular sends
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   383
     and via constructed performs. The reason is to test both inlined
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   384
     JIT-compiler code AND the regular methods code."
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   385
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   386
    ^ 2.
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   387
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   388
    "
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   389
     self testIntegerShifts3
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   390
    "
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   391
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   392
    "Created: / 6.6.1999 / 14:47:51 / cg"
95
362e58ff28ba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 91
diff changeset
   393
    "Modified: / 9.6.1999 / 17:49:57 / cg"
362e58ff28ba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 91
diff changeset
   394
!
89
228f2b80bc17 bitShift-test
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   395
19
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   396
num_00000000000007FFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   397
    ^ 16r00000000000007FFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   398
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   399
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   400
    "Created: / 4.6.1999 / 15:34:12 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   401
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   402
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   403
num_00000000000008000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   404
    ^ 16r00000000000008000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   405
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   406
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   407
    "Created: / 4.6.1999 / 15:39:32 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   408
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   409
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   410
num_0000000000000FFFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   411
    ^ 16r0000000000000FFFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   412
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   413
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   414
    "Created: / 4.6.1999 / 15:34:26 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   415
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   416
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   417
num_00000000000010000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   418
    ^ 16r00000000000010000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   419
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   420
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   421
    "Created: / 4.6.1999 / 15:34:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   422
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   423
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   424
num_00000000000100000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   425
    ^ 16r00000000000100000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   426
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   427
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   428
    "Created: / 4.6.1999 / 15:34:36 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   429
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   430
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   431
num_000000000007FFFFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   432
    ^ 16r000000000007FFFFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   433
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   434
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   435
    "Created: / 4.6.1999 / 15:37:48 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   436
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   437
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   438
num_00000000000800000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   439
    ^ 16r00000000000800000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   440
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   441
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   442
    "Created: / 4.6.1999 / 15:39:43 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   443
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   444
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   445
num_00000000000FFFFFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   446
    ^ 16r00000000000FFFFFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   447
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   448
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   449
    "Created: / 4.6.1999 / 15:37:52 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   450
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   451
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   452
num_00000000001000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   453
    ^ 16r00000000001000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   454
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   455
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   456
    "Created: / 4.6.1999 / 15:34:42 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   457
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   458
22
7f01716fbbe2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 21
diff changeset
   459
num_0000000000FFF0000
7f01716fbbe2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 21
diff changeset
   460
    ^ 16r0000000000FFF0000
7f01716fbbe2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 21
diff changeset
   461
7f01716fbbe2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 21
diff changeset
   462
    "self num_0000000000FFF0000 hexPrintString"
7f01716fbbe2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 21
diff changeset
   463
7f01716fbbe2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 21
diff changeset
   464
    "Created: / 4.6.1999 / 17:44:26 / cg"
7f01716fbbe2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 21
diff changeset
   465
    "Modified: / 4.6.1999 / 18:40:47 / cg"
7f01716fbbe2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 21
diff changeset
   466
!
7f01716fbbe2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 21
diff changeset
   467
19
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   468
num_00000000010000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   469
    ^ 16r00000000010000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   470
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   471
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   472
    "Created: / 4.6.1999 / 15:34:46 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   473
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   474
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   475
num_0000000007FFFFFFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   476
    ^ 16r0000000007FFFFFFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   477
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   478
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   479
    "Created: / 4.6.1999 / 15:37:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   480
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   481
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   482
num_00000000080000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   483
    ^ 16r00000000080000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   484
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   485
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   486
    "Created: / 4.6.1999 / 15:39:56 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   487
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   488
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   489
num_000000000FFFFFFFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   490
    ^ 16r000000000FFFFFFFF
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   491
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   492
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   493
    "Created: / 4.6.1999 / 15:36:16 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   494
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   495
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   496
num_00000000100000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   497
    ^ 16r00000000100000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   498
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   499
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   500
    "Created: / 4.6.1999 / 15:34:51 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   501
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   502
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   503
num_00000001000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   504
    ^ 16r00000001000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   505
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   506
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   507
    "Created: / 4.6.1999 / 15:34:57 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   508
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   509
21
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   510
num_0000000FFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   511
    ^ 16r0000000FFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   512
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   513
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   514
    "Created: / 4.6.1999 / 17:41:08 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   515
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   516
19
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   517
num_00000010000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   518
    ^ 16r00000010000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   519
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   520
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   521
    "Created: / 4.6.1999 / 15:35:03 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   522
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   523
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   524
num_00000100000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   525
    ^ 16r00000100000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   526
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   527
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   528
    "Created: / 4.6.1999 / 15:35:07 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   529
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   530
21
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   531
num_00000FFFFFFFFFF00
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   532
    ^ 16r00000FFFFFFFFFF00
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   533
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   534
    "self num_00000FFFFFFFFFF00"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   535
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   536
    "Created: / 4.6.1999 / 17:44:26 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   537
    "Modified: / 4.6.1999 / 17:46:20 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   538
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   539
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   540
num_00000FFFFFFFFFF80
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   541
    ^ 16r00000FFFFFFFFFF80
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   542
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   543
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   544
    "Created: / 4.6.1999 / 17:44:23 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   545
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   546
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   547
num_00000FFFFFFFFFFC0
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   548
    ^ 16r00000FFFFFFFFFFC0
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   549
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   550
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   551
    "Created: / 4.6.1999 / 17:44:20 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   552
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   553
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   554
num_00000FFFFFFFFFFE0
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   555
    ^ 16r00000FFFFFFFFFFE0
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   556
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   557
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   558
    "Created: / 4.6.1999 / 17:44:16 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   559
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   560
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   561
num_00000FFFFFFFFFFF0
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   562
    ^ 16r00000FFFFFFFFFFF0
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   563
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   564
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   565
    "Created: / 4.6.1999 / 17:44:12 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   566
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   567
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   568
num_00000FFFFFFFFFFF8
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   569
    ^ 16r00000FFFFFFFFFFF8
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   570
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   571
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   572
    "Created: / 4.6.1999 / 17:44:09 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   573
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   574
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   575
num_00000FFFFFFFFFFFC
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   576
    ^ 16r00000FFFFFFFFFFFC
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   577
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   578
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   579
    "Created: / 4.6.1999 / 17:44:05 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   580
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   581
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   582
num_00000FFFFFFFFFFFE
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   583
    ^ 16r00000FFFFFFFFFFFE
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   584
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   585
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   586
    "Created: / 4.6.1999 / 17:45:12 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   587
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   588
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   589
num_00000FFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   590
    ^ 16r00000FFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   591
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   592
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   593
    "Created: / 4.6.1999 / 17:41:22 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   594
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   595
19
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   596
num_00001000000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   597
    ^ 16r00001000000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   598
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   599
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   600
    "Created: / 4.6.1999 / 15:35:13 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   601
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   602
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   603
num_00010000000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   604
    ^ 16r00010000000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   605
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   606
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   607
    "Created: / 4.6.1999 / 15:35:18 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   608
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   609
21
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   610
num_000FFFFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   611
    ^ 16r000FFFFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   612
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   613
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   614
    "Created: / 4.6.1999 / 17:41:26 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   615
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   616
19
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   617
num_00100000000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   618
    ^ 16r00100000000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   619
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   620
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   621
    "Created: / 4.6.1999 / 15:35:22 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   622
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   623
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   624
num_01000000000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   625
    ^ 16r01000000000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   626
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   627
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   628
    "Created: / 4.6.1999 / 15:35:27 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   629
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   630
21
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   631
num_0FFFFFFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   632
    ^ 16r0FFFFFFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   633
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   634
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   635
    "Created: / 4.6.1999 / 17:41:30 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   636
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   637
19
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   638
num_10000000000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   639
    ^ 16r10000000000000000
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   640
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   641
    "Modified: / 4.6.1999 / 15:29:31 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   642
    "Created: / 4.6.1999 / 15:35:32 / cg"
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   643
!
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   644
172
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   645
num_16r80000000
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   646
    ^ 16r80000000
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   647
!
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   648
21
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   649
num_1FFFFFFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   650
    ^ 16r1FFFFFFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   651
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   652
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   653
    "Created: / 4.6.1999 / 17:41:51 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   654
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   655
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   656
num_20000000000000000
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   657
    ^ 16r20000000000000000
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   658
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   659
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   660
    "Created: / 4.6.1999 / 17:40:26 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   661
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   662
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   663
num_3FFFFFFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   664
    ^ 16r3FFFFFFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   665
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   666
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   667
    "Created: / 4.6.1999 / 17:42:07 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   668
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   669
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   670
num_40000000000000000
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   671
    ^ 16r40000000000000000
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   672
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   673
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   674
    "Created: / 4.6.1999 / 17:40:29 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   675
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   676
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   677
num_7FFFFFFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   678
    ^ 16r7FFFFFFFFFFFFFFFF
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   679
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   680
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   681
    "Created: / 4.6.1999 / 17:42:24 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   682
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   683
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   684
num_80000000000000000
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   685
    ^ 16r80000000000000000
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   686
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   687
    "Modified: / 4.6.1999 / 15:29:31 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   688
    "Created: / 4.6.1999 / 17:40:33 / cg"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   689
!
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   690
20
c6b0a35e5bc7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
   691
num_smallInt_maxVal
c6b0a35e5bc7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
   692
    ^ SmallInteger maxVal
c6b0a35e5bc7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
   693
21
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   694
    "self num_smallInt_maxVal"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   695
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   696
    "Modified: / 4.6.1999 / 17:33:22 / cg"
20
c6b0a35e5bc7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
   697
!
c6b0a35e5bc7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
   698
c6b0a35e5bc7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
   699
num_smallInt_minVal
c6b0a35e5bc7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
   700
    ^ SmallInteger minVal
c6b0a35e5bc7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
   701
21
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   702
    "self num_smallInt_minVal"
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   703
20
c6b0a35e5bc7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 19
diff changeset
   704
    "Created: / 4.6.1999 / 16:26:05 / cg"
21
7acbbe514e11 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 20
diff changeset
   705
    "Modified: / 4.6.1999 / 17:34:31 / cg"
2
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   706
! !
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   707
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   708
!IntegerTest methodsFor:'tests'!
2
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   709
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   710
doTestAll
10
3cbe91972e2b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 9
diff changeset
   711
    "general conversion & arithmetic tests.
3cbe91972e2b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 9
diff changeset
   712
     Notice, the arithmetic tests are both performed via regular sends
3cbe91972e2b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 9
diff changeset
   713
     and via constructed performs. The reason is to test both inlined
3cbe91972e2b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 9
diff changeset
   714
     JIT-compiler code AND the regular methods code."
2
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   715
57
14aec105070d category
Claus Gittinger <cg@exept.de>
parents: 56
diff changeset
   716
    self testInteger1.
54
77b06a241d57 ilc check
Claus Gittinger <cg@exept.de>
parents: 53
diff changeset
   717
    self testILC.
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
   718
    self testSmallIntegerArithmetic.
19
c21f3bbedd21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 18
diff changeset
   719
    self testLiteralNumbers.
15
99df9ea7f146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 14
diff changeset
   720
    self testLargeAddition.
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
   721
    self testLargeMultiplication.
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
   722
    self testLargeDivision.
545
99ccb895860f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   723
    self testLargeBitOperations.
42
b7e57becd932 more tests
Claus Gittinger <cg@exept.de>
parents: 41
diff changeset
   724
    self testIntegerShifts.
b7e57becd932 more tests
Claus Gittinger <cg@exept.de>
parents: 41
diff changeset
   725
    self testEncodeDecode.
53
94b4cfba8e21 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 52
diff changeset
   726
    self testIntegerMisc.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   727
    self testInline1
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
   728
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
   729
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   730
     self basicNew doTestAll
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
   731
    "
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
   732
91
a781d70791b7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   733
    "Modified: / 31.10.2000 / 20:23:20 / cg"
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
   734
!
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
   735
172
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   736
testComparing
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   737
    |a b|
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   738
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   739
    a := 12.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   740
    b := 16r80000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   741
    self doCompare:a againstGreater:b.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   742
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   743
    a := 12.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   744
    b := 16r80000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   745
    self doCompare:a againstGreater:16r80000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   746
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   747
    a := 0.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   748
    self doCompare:a againstGreater:16r80000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   749
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   750
    a := -1.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   751
    self doCompare:a againstGreater:16r80000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   752
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   753
    a := 16r-80000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   754
    self doCompare:a againstGreater:16r80000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   755
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   756
    a := 16r-40000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   757
    self doCompare:a againstGreater:16r80000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   758
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   759
    a := 16r-40000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   760
    self doCompare:a againstGreater:16r40000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   761
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   762
    a := 16r-3FFFFFFF.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   763
    self doCompare:a againstGreater:16r3FFFFFFF.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   764
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   765
    a := 16r-40000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   766
    self doCompare:a againstGreater:16r3FFFFFFF.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   767
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   768
    a := 16r-3FFFFFFF.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   769
    self doCompare:a againstGreater:16r40000000.
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   770
362
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   771
    "/ smallint-largeInt boundaries
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   772
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   773
    a := 16r3FFFFFFE.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   774
    self doCompare:a againstEqual:16r3FFFFFFE.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   775
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   776
    a := 16r3FFFFFFE.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   777
    self doCompare:a againstGreater:16r3FFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   778
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   779
    a := 16r3FFFFFFE.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   780
    self doCompare:a againstGreater:16r40000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   781
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   782
    a := 16r3FFFFFFE.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   783
    self doCompare:a againstGreater:16r80000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   784
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   785
    a := 16r3FFFFFFE.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   786
    self doCompare:a againstGreater:16rFFFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   787
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   788
    a := 16r3FFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   789
    self doCompare:a againstEqual:16r3FFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   790
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   791
    a := 16r3FFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   792
    self doCompare:a againstGreater:16r40000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   793
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   794
    a := 16r3FFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   795
    self doCompare:a againstGreater:16r80000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   796
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   797
    a := 16r3FFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   798
    self doCompare:a againstGreater:16rFFFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   799
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   800
    a := 16r40000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   801
    self doCompare:a againstEqual:16r40000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   802
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   803
    a := 16r40000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   804
    self doCompare:a againstGreater:16r80000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   805
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   806
    a := 16r40000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   807
    self doCompare:a againstGreater:16rFFFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   808
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   809
    a := 16r7FFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   810
    self doCompare:a againstEqual:16r7FFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   811
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   812
    a := 16r7FFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   813
    self doCompare:a againstGreater:16r80000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   814
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   815
    a := 16r7FFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   816
    self doCompare:a againstGreater:16rFFFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   817
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   818
    a := 16r80000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   819
    self doCompare:a againstEqual:16r80000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   820
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   821
    a := 16r80000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   822
    self doCompare:a againstGreater:16rFFFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   823
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   824
    a := 16rFFFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   825
    self doCompare:a againstEqual:16rFFFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   826
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   827
    a := 16rFFFFFFFF.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   828
    self doCompare:a againstGreater:16r100000000.
c2504e878ebd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 337
diff changeset
   829
172
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   830
    "
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   831
     self basicNew testComparing
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   832
    "
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   833
!
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   834
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   835
testConstants
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   836
    |t|
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   837
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   838
    self assert:((t := self num_16r80000000) > 0).
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   839
    self assert:((t := self num_16r80000000) = 16r80000000).
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   840
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   841
    "
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   842
     self basicNew testConstants
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   843
    "
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   844
!
4007fa906cab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
   845
2395
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   846
testILC
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   847
    "inline-cache"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   848
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   849
    self assert:((self checkIsInteger:1) == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   850
    self assert:((self checkIsInteger:nil) == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   851
    self assert:((self checkIsInteger:1) == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   852
    self assert:((self checkIsInteger:nil) == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   853
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   854
    self assert:((self checkIsInteger:0) == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   855
    self assert:((self checkIsInteger:nil) == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   856
    self assert:((self checkIsInteger:0) == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   857
    self assert:((self checkIsInteger:nil) == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   858
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   859
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   860
     self basicNew testILC
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   861
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   862
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   863
    "Created: / 6.6.1999 / 14:47:51 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   864
    "Modified: / 9.6.1999 / 17:49:57 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   865
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   866
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   867
testInline1
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   868
    "inlined tests.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   869
     Notice, the arithmetic tests are both performed via regular sends
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   870
     and via constructed performs. The reason is to test both inlined
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   871
     JIT-compiler code AND the regular methods code."
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   872
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   873
    self assert:( (self absPlusOneOf:1) = 2 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   874
    self assert:( (self absPlusOneOf:-1) = 2 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   875
    self assert:( (self absPlusOneOf:1.0) = 2 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   876
    self assert:( (self absPlusOneOf:-1.0) = 2 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   877
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   878
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   879
     self basicNew testInline1
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   880
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   881
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   882
    "Created: / 31.10.2000 / 20:22:48 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   883
    "Modified: / 31.10.2000 / 20:23:06 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   884
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   885
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   886
testInteger1
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   887
    "general conversion & arithmetic tests.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   888
     Notice, the arithmetic tests are both performed via regular sends
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   889
     and via constructed performs. The reason is to test both inlined
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   890
     JIT-compiler code AND the regular method's code."
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   891
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   892
    |minVal maxVal maxValPlus1 minValMinus1 halfMin halfMax t|
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   893
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   894
    minVal := SmallInteger perform:('minVal' asSymbol).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   895
    maxVal := SmallInteger perform:('maxVal' asSymbol).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   896
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   897
    self assert:(minVal class == SmallInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   898
    self assert:(maxVal class == SmallInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   899
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   900
    self assert:(minVal == self num_smallInt_minVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   901
    self assert:(maxVal == self num_smallInt_maxVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   902
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   903
    self assert:(minVal == SmallInteger minVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   904
    self assert:(maxVal == SmallInteger maxVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   905
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   906
    t := SmallInteger perform:('maxBytes' asSymbol).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   907
    self assert:(t == SmallInteger maxBytes).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   908
    t := SmallInteger perform:('maxBits' asSymbol).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   909
    self assert:(t == SmallInteger maxBits).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   910
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   911
    self testPrinting1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   912
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   913
    self assert:(SmallInteger maxBytes == ExternalAddress pointerSize).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   914
    "/ again, preventing inlining by compiler
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   915
    self assert:(SmallInteger perform:#maxBytes) == (ExternalAddress perform:#pointerSize).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   916
    self assert:(SmallInteger perform:'maxBytes' asSymbol) == (ExternalAddress perform:'pointerSize' asSymbol).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   917
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   918
    SmallInteger maxBytes == 4 ifTrue:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   919
        self assert:(minVal hexPrintString = '-40000000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   920
        self assert:(maxVal hexPrintString = '3FFFFFFF').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   921
        self assert:(minVal == -1073741824).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   922
        self assert:(maxVal == 1073741823).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   923
        maxValPlus1 := 1073741824.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   924
        minValMinus1 := -1073741825.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   925
        self assert:(minValMinus1 hexPrintString = '-40000001').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   926
        self assert:(maxValPlus1 hexPrintString = '40000000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   927
        halfMin := 16r-20000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   928
        halfMax := 16r20000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   929
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   930
    SmallInteger maxBytes == 8 ifTrue:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   931
        self assert:(minVal hexPrintString = '-4000000000000000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   932
        self assert:(maxVal hexPrintString = '3FFFFFFFFFFFFFFF').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   933
        self assert:(minVal == -4611686018427387904).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   934
        self assert:(maxVal == 4611686018427387903).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   935
        maxValPlus1 := 4611686018427387904.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   936
        minValMinus1 := -4611686018427387905.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   937
        self assert:(minValMinus1 hexPrintString = '-4000000000000001').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   938
        self assert:(maxValPlus1 hexPrintString = '4000000000000000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   939
        halfMin := 16r-2000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   940
        halfMax := 16r2000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   941
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   942
    
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   943
    self assert:(minValMinus1 class == LargeInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   944
    self assert:(maxValPlus1 class == LargeInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   945
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   946
    "arithmetic overFlow checks"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   947
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   948
"/    self assert:((maxVal + 1) inspect.maxValPlus1 inspect. true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   949
    self assert:((maxVal perform:'+' asSymbol with:1) = maxValPlus1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   950
    self assert:((maxVal + 1) = maxValPlus1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   951
    self assert:((minVal perform:'-' asSymbol with:1) = minValMinus1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   952
    self assert:((minVal - 1) = minValMinus1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   953
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   954
    self assert:((halfMax perform:'+' asSymbol with:halfMax) = maxValPlus1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   955
    self assert:((halfMax + halfMax) = maxValPlus1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   956
    self assert:((halfMin perform:'+' asSymbol with:halfMin) == minVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   957
    self assert:((halfMin + halfMin) == minVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   958
    self assert:((halfMax perform:'*' asSymbol with:2) = maxValPlus1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   959
    self assert:((halfMax * 2) = maxValPlus1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   960
    self assert:((halfMin perform:'*' asSymbol with:2) == minVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   961
    self assert:((halfMin * 2) == minVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   962
    self assert:((maxValPlus1 perform:'//' asSymbol with:2) == halfMax).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   963
    self assert:((maxValPlus1 // 2) == halfMax).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   964
    self assert:((halfMax perform:'bitShift:' asSymbol with:1) = maxValPlus1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   965
    self assert:((halfMin perform:'bitShift:' asSymbol with:1) == minVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   966
    self assert:((halfMax bitShift:1) = maxValPlus1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   967
    self assert:((halfMin bitShift:1) == minVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   968
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   969
    "LargeInt op -> SmallInt result"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   970
    t := maxVal + 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   971
    self assert:(t - 1 == maxVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   972
    t := minVal - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   973
    self assert:(t + 1 == minVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   974
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   975
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   976
     self basicNew testInteger1
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   977
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   978
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   979
    "Modified: / 19-09-2017 / 16:27:24 / stefan"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   980
    "Modified: / 10-10-2017 / 12:13:02 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   981
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   982
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   983
testIntegerMisc
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   984
    "misc tests.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   985
     Notice, the arithmetic tests are both performed via regular sends
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   986
     and via constructed performs. The reason is to test both inlined
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   987
     JIT-compiler code AND the regular methods code."
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   988
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   989
    |n1 n2 s|
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   990
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   991
    n1 := 100000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   992
    n2 := n1 negated.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   993
    s := 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   994
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   995
    self assert:(n1 printString = '100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   996
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   997
    self assert:(n1 negated printString = '-100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   998
    self assert:((n1 perform:'negated' asSymbol) printString = '-100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   999
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1000
    self assert:(n1 negated abs printString = '100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1001
    self assert:((n1 perform:'negated' asSymbol) abs printString = '100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1002
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1003
    self assert:(n1 abs negated printString = '-100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1004
    self assert:((n1 perform:'abs' asSymbol) negated printString = '-100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1005
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1006
    n1 := SmallInteger maxVal.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1007
    self assert:(n1 negated class == SmallInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1008
    self assert:((n1 perform:'negated' asSymbol) class == SmallInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1009
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1010
    n1 := SmallInteger minVal.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1011
    self assert:(n1 class == SmallInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1012
    "/ Transcript showCR:n1 printString.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1013
    "/ Transcript showCR:n1 negated printString.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1014
    "/ Transcript showCR:n1 negated class printString.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1015
    self assert:(n1 negated class == LargeInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1016
    self assert:((n1 perform:'negated' asSymbol) class == LargeInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1017
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1018
    n1 := SmallInteger maxVal.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1019
    self assert:(n1 negated negated class == SmallInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1020
    self assert:(((n1 perform:'negated' asSymbol) perform:'negated' asSymbol) class == SmallInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1021
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1022
    n1 := SmallInteger minVal.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1023
    self assert:(n1 negated negated class == SmallInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1024
    self assert:(((n1 perform:'negated' asSymbol) perform:'negated' asSymbol) class == SmallInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1025
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1026
    n1 := SmallInteger minVal negated - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1027
    self assert:(n1 negated class == SmallInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1028
    self assert:((n1 perform:'negated' asSymbol) class == SmallInteger).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1029
    self assert:(n1 == SmallInteger maxVal).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1030
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1031
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1032
     self basicNew testIntegerMisc
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1033
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1034
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1035
    "Created: / 6.6.1999 / 14:47:51 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1036
    "Modified: / 9.6.1999 / 17:49:57 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1037
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1038
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1039
testIntegerMisc2
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1040
    "misc tests.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1041
     Notice, the arithmetic tests are both performed via regular sends
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1042
     and via constructed performs. The reason is to test both inlined
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1043
     JIT-compiler code AND the regular methods code."
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1044
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1045
    |n sel|
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1046
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1047
    "/ fib is optional
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1048
    (0 respondsTo:#fib) ifFalse:[^ self].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1049
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1050
    self assert:(0 fib == 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1051
    self assert:(1 fib == 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1052
    self assert:(2 fib == 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1053
    self assert:(3 fib == 2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1054
    self assert:(4 fib == 3).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1055
    self assert:(5 fib == 5).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1056
    self assert:(6 fib == 8).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1057
    self assert:(7 fib == 13).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1058
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1059
    n := 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1060
    self assert:(n fib == 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1061
    n := 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1062
    self assert:(n fib == 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1063
    n := 2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1064
    self assert:(n fib == 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1065
    n := 3.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1066
    self assert:(n fib == 2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1067
    n := 4.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1068
    self assert:(n fib == 3).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1069
    n := 5.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1070
    self assert:(n fib == 5).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1071
    n := 6.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1072
    self assert:(n fib == 8).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1073
    n := 7.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1074
    self assert:(n fib == 13).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1075
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1076
    #(0 1 2 3 4 5 6 7)
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1077
    with:#(0 1 1 2 3 5 8 13)
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1078
    do:[:n :rslt |
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1079
	self assert:(n fib == rslt).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1080
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1081
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1082
"/    #(0 1 2 3 4 5 6 7)
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1083
"/    with:#(0 1 1 2 3 5 8 13)
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1084
"/    do:[:n :rslt |
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1085
"/        self assert:(n fib_recursive == rslt).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1086
"/    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1087
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1088
    sel := #fib.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1089
    self assert:((0 perform:sel) == 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1090
    self assert:((1 perform:sel) == 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1091
    self assert:((2 perform:sel) == 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1092
    self assert:((3 perform:sel) == 2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1093
    self assert:((4 perform:sel) == 3).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1094
    self assert:((5 perform:sel) == 5).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1095
    self assert:((6 perform:sel) == 8).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1096
    self assert:((7 perform:sel) == 13).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1097
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1098
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1099
     self basicNew testIntegerMisc2
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1100
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1101
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1102
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1103
testLargeCompare
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1104
    "compare tests"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1105
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1106
    #(
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1107
        ( 16r3fffffff 16r40000000 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1108
        ( 16r40000000 16r3fffffff #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1109
        ( 16r40000000 16r40000000 #equal )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1110
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1111
        ( 16r40000000 16r40000001 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1112
        ( 16r40000001 16r40000000 #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1113
        ( 16r40000001 16r40000001 #equal )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1114
        
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1115
        ( 16r3fffffffffffffff 16r4000000000000000 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1116
        ( 16r4000000000000000 16r3fffffffffffffff #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1117
        ( 16r4000000000000000 16r4000000000000000 #equal )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1118
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1119
        ( 16r4000000000000000 16r4000000000000001 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1120
        ( 16r4000000000000001 16r4000000000000000 #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1121
        ( 16r4000000000000001 16r4000000000000001 #equal )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1122
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1123
        ( 16r3fffffffffffffffffffffff 16r400000000000000000000000 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1124
        ( 16r400000000000000000000000 16r3fffffffffffffffffffffff #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1125
        ( 16r400000000000000000000000 16r400000000000000000000000 #equal )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1126
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1127
        ( 16r400000000000000000000000 16r400000000000000000000001 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1128
        ( 16r400000000000000000000001 16r400000000000000000000000 #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1129
        ( 16r400000000000000000000001 16r400000000000000000000001 #equal )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1130
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1131
        ( 16r3fffffff 16r400000000000 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1132
        ( 16r400000000000 16r3fffffff #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1133
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1134
        ( 16r40000000 16r400000000001 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1135
        ( 16r400000000001 16r40000000 #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1136
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1137
        ( 16r3fffffffffffffff 16r40000000000000000000 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1138
        ( 16r40000000000000000000 16r3fffffffffffffff #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1139
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1140
        ( 16r4000000000000000 16r40000000000000000001 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1141
        ( 16r40000000000000000001 16r4000000000000000 #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1142
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1143
        ( 16r3fffffffffffffffffffffff 16r400000000000000000000000 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1144
        ( 16r400000000000000000000000 16r3fffffffffffffffffffffff #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1145
        ( 16r400000000000000000000000 16r400000000000000000000000 #equal )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1146
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1147
        ( 16r400000000000000000000000 16r400000000000000000000001 #less )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1148
        ( 16r400000000000000000000001 16r400000000000000000000000 #greater )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1149
        ( 16r400000000000000000000001 16r400000000000000000000001 #equal )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1150
    ) do:[:triple |
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1151
        |v1 v2 expected rslt|
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1152
        
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1153
        v1 := triple at:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1154
        v2 := triple at:2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1155
        expected := triple at:3.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1156
        expected == #less ifTrue:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1157
            self assert:(v1 < v2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1158
            self assert:(v1 <= v2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1159
            self assert:(v1 > v2) not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1160
            self assert:(v1 >= v2) not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1161
            self assert:(v1 = v2) not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1162
            self assert:(v1 ~= v2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1163
        ].    
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1164
        expected == #greater ifTrue:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1165
            self assert:(v1 > v2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1166
            self assert:(v1 >= v2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1167
            self assert:(v1 < v2) not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1168
            self assert:(v1 <= v2) not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1169
            self assert:(v1 = v2) not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1170
            self assert:(v1 ~= v2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1171
        ].    
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1172
        expected == #equal ifTrue:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1173
            self assert:(v1 > v2) not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1174
            self assert:(v1 >= v2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1175
            self assert:(v1 < v2) not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1176
            self assert:(v1 <= v2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1177
            self assert:(v1 = v2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1178
            self assert:(v1 ~= v2) not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1179
        ].    
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1180
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1181
    self assert:(100 factorial < 101 factorial).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1182
    self assert:(100 factorial > 100 factorial negated).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1183
    
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1184
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1185
     self basicNew testLargeCompare
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1186
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1187
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1188
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1189
testLargeCompression1
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1190
    |l nullBytes|
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1191
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1192
    #(
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1193
	#[ 1 ]          16r01
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1194
	#[ 1 2 ]        16r0201
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1195
	#[ 1 2 3]       16r030201
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1196
	#[ 1 2 3 4]     16r04030201
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1197
    ) pairWiseDo:[:bytes :expected |
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1198
	0 to:16 do:[:nNullBytes |
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1199
	    nullBytes := ByteArray new:nNullBytes withAll:0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1200
	    l := LargeInteger digitBytes:(bytes , nullBytes).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1201
	    self assert:( l compressed == expected ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1202
	].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1203
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1204
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1205
    #(
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1206
	#[ 1 2 3 4 5]       16r0504030201
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1207
	#[ 1 2 3 4 5 6]     16r060504030201
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1208
	#[ 1 2 3 4 5 6 7]   16r07060504030201
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1209
	#[ 1 2 3 4 5 6 7 8] 16r0807060504030201
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1210
    ) pairWiseDo:[:bytes :expected |
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1211
	0 to:16 do:[:nNullBytes |
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1212
	    nullBytes := ByteArray new:nNullBytes withAll:0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1213
	    l := LargeInteger digitBytes:(bytes , nullBytes).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1214
	    ExternalAddress pointerSize == 8 ifTrue:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1215
		self assert:( l compressed == expected ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1216
	    ] ifFalse:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1217
		self assert:( l compressed = expected ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1218
	    ]
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1219
	]
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1220
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1221
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1222
    #(
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1223
	#[ 1 2 3 4 5 6 7 8 9]       16r090807060504030201
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1224
	#[ 1 2 3 4 5 6 7 8 9 10]    16r0a090807060504030201
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1225
	#[ 1 2 3 4 5 6 7 8 9 10 11] 16r0b0a090807060504030201
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1226
    ) pairWiseDo:[:bytes :expected |
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1227
	0 to:16 do:[:nNullBytes |
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1228
	    nullBytes := ByteArray new:nNullBytes withAll:0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1229
	    l := LargeInteger digitBytes:(bytes , nullBytes).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1230
	    self assert:( l compressed = expected ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1231
	]
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1232
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1233
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1234
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1235
     self basicNew testLargeCompression1
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1236
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1237
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1238
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1239
testLargeIntegerHelpers
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1240
    |t1 t2|
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1241
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1242
    "/ mul2
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1243
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1244
    t1 := 16r12345678901234567890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1245
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1246
    self assert:(t2 mul2 = (t1 * 2)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1247
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1248
    t1 := 16r1234567890123456789012345678901234567890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1249
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1250
    self assert:(t2 mul2 = (t1 * 2)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1251
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1252
    t1 := 16r123456789012345678901234567890123456789012345678901234567890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1253
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1254
    self assert:(t2 mul2 = (t1 * 2)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1255
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1256
    t1 := 16r12345678901234567890123456789012345678901234567890123456789012345678901234567890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1257
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1258
    self assert:(t2 mul2 = (t1 * 2)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1259
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1260
    t1 := 10000 factorial.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1261
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1262
    self assert:(t2 mul2 = (t1 * 2)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1263
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1264
    t1 := 16r123456789012345678901234567890123456789012345678901234567890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1265
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1266
    self assert:(t2 mul2 = (t1 * 2)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1267
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1268
"/    t1 := 1000 factorial.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1269
"/    t := Time millisecondsToRun:[ 100000 timesRepeat:[ t1 mul2. ] ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1270
"/    Transcript showCR:t.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1271
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1272
    "/ div2
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1273
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1274
    t1 := 16r12345678901234567890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1275
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1276
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1277
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1278
    "/ do not compare t2 = t1 // x, because t2 may be unnormalized
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1279
    self assert:(t2 printStringRadix:16) = ((t1 // 2) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1280
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1281
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1282
    self assert:(t2 printStringRadix:16) = ((t1 // 4) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1283
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1284
    self assert:(t2 printStringRadix:16) = ((t1 // 8) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1285
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1286
    self assert:(t2 printStringRadix:16) = ((t1 // 16) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1287
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1288
    self assert:(t2 printStringRadix:16) = ((t1 // 32) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1289
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1290
    self assert:(t2 printStringRadix:16) = ((t1 // 64) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1291
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1292
    self assert:(t2 printStringRadix:16) = ((t1 // 128) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1293
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1294
    self assert:(t2 printStringRadix:16) = ((t1 // 256) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1295
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1296
    self assert:(t2 printStringRadix:16) = ((t1 // 512) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1297
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1298
    self assert:(t2 printStringRadix:16) = ((t1 // 1024) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1299
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1300
    t1 := 16r1234567890123456789012345678901234567890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1301
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1302
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1303
    self assert:(t2 printStringRadix:16) = ((t1 // 2) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1304
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1305
    t1 := 16r123456789012345678901234567890123456789012345678901234567890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1306
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1307
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1308
    self assert:(t2 printStringRadix:16) = ((t1 // 2) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1309
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1310
    t1 := 16r12345678901234567890123456789012345678901234567890123456789012345678901234567890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1311
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1312
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1313
    self assert:(t2 printStringRadix:16) = ((t1 // 2) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1314
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1315
    self assert:(t2 printStringRadix:16) = ((t1 // 4) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1316
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1317
    self assert:(t2 printStringRadix:16) = ((t1 // 8) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1318
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1319
    self assert:(t2 printStringRadix:16) = ((t1 // 16) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1320
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1321
    t1 := 10000 factorial.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1322
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1323
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1324
    self assert:(t2 printStringRadix:16) = ((t1 // 2) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1325
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1326
    t1 := 16r123456789012345678901234567890123456789012345678901234567890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1327
    t2 := t1 deepCopy.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1328
    t2 div2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1329
    self assert:(t2 printStringRadix:16) = ((t1 // 2) printStringRadix:16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1330
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1331
    t1 := 12345678901234567890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1332
    t2 := t1 divMod:1000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1333
    self assert:(t2 at:1) = 12345678901234567.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1334
    self assert:(t2 at:2) = 890.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1335
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1336
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1337
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1338
     self basicNew testLargeIntegerHelpers
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1339
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1340
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1341
    "Modified: / 20.5.1999 / 09:41:19 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1342
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1343
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1344
testLargeIntegerHelpers2
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1345
    |t1 r|
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1346
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1347
    "/ absSubtract:
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1348
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1349
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1350
    r := t1 absDestructiveSubtract:16r00ffffffffffffffff.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1351
    self assert:(t1 digitBytes = #[16r01 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1352
    self assert:(r == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1353
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1354
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1355
    r := t1 absDestructiveSubtract:16r010000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1356
    self assert:(t1 digitBytes = #[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1357
    self assert:(r == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1358
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1359
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1360
    r := t1 absDestructiveSubtract:16r00ffffffffffffffffff.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1361
    self assert:(t1 digitBytes = #[16r01 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1362
    self assert:(r == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1363
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1364
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1365
    r := t1 absDestructiveSubtract:16r01000000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1366
    self assert:(t1 digitBytes = #[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1367
    self assert:(r == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1368
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1369
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1370
    r := t1 absDestructiveSubtract:16r00ffffffffffffffffffff.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1371
    self assert:(t1 digitBytes = #[16r01 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1372
    self assert:(r == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1373
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1374
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1375
    r := t1 absDestructiveSubtract:16r0100000000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1376
    self assert:(t1 digitBytes = #[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1377
    self assert:(r == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1378
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1379
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1380
    r := t1 absDestructiveSubtract:16r00ffffffffffffffffffffff.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1381
    self assert:(t1 digitBytes = #[16r01 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1382
    self assert:(r == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1383
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1384
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1385
    r := t1 absDestructiveSubtract:16r010000000000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1386
    self assert:(t1 digitBytes = #[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1387
    self assert:(r == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1388
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1389
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1390
    r := t1 absDestructiveSubtract:16r00ffffffffffffffffffffffff.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1391
    self assert:(t1 digitBytes = #[16r01 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1392
    self assert:(r == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1393
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1394
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1395
    r := t1 absDestructiveSubtract:16r01000000000000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1396
    self assert:(t1 digitBytes = #[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1397
    self assert:(r == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1398
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1399
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1400
    r := t1 absDestructiveSubtract:16r00ffffffffffffffffffffffffff.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1401
    self assert:(t1 digitBytes = #[16r01 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1402
    self assert:(r == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1403
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1404
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1405
    r := t1 absDestructiveSubtract:16r0100000000000000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1406
    self assert:(t1 digitBytes = #[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1407
    self assert:(r == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1408
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1409
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1410
    r := t1 absDestructiveSubtract:16r00ffffffffffffffffffffffffffff.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1411
    self assert:(t1 digitBytes = #[16r01 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1412
    self assert:(r == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1413
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1414
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1415
    r := t1 absDestructiveSubtract:16r010000000000000000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1416
    self assert:(t1 digitBytes = #[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1417
    self assert:(r == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1418
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1419
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1420
    r := t1 absDestructiveSubtract:16r00ffffffffffffffffffffffffffffff.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1421
    self assert:(t1 digitBytes = #[16r01 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1422
    self assert:(r == true).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1423
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1424
    t1 := LargeInteger digitBytes:#[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r01 ] copy sign:1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1425
    r := t1 absDestructiveSubtract:16r01000000000000000000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1426
    self assert:(t1 digitBytes = #[16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 ]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1427
    self assert:(r == false).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1428
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1429
     self basicNew testLargeIntegerHelpers2
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1430
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1431
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1432
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1433
testLargeIntegerHelpers3
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1434
    "/ absDivMod:
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1435
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1436
     self assert:(9000000000000000000 absDivMod: 4000) = #(2250000000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1437
     self assert:(-9000000000000000000 absDivMod: 4000) = #(2250000000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1438
     self assert:(9000000000000000000 absDivMod: -4000) = #(2250000000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1439
     self assert:(-9000000000000000000 absDivMod: -4000) = #(2250000000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1440
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1441
     self assert:(9000000000000000001 absDivMod: 4000) = #(2250000000000000 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1442
     self assert:(-9000000000000000001 absDivMod: 4000) = #(2250000000000000 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1443
     self assert:(9000000000000000001 absDivMod: -4000) = #(2250000000000000 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1444
     self assert:(-9000000000000000001 absDivMod: -4000) = #(2250000000000000 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1445
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1446
     self assert:(9000000000000000000 absDivMod: 40000) = #(225000000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1447
     self assert:(-9000000000000000000 absDivMod: 40000) = #(225000000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1448
     self assert:(9000000000000000000 absDivMod: -40000) = #(225000000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1449
     self assert:(-9000000000000000000 absDivMod: -40000) = #(225000000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1450
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1451
     self assert:(9000000000000000000 absDivMod: 400000) = #(22500000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1452
     self assert:(-9000000000000000000 absDivMod: 400000) = #(22500000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1453
     self assert:(9000000000000000000 absDivMod: -400000) = #(22500000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1454
     self assert:(-9000000000000000000 absDivMod: -400000) = #(22500000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1455
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1456
     self assert:(9000000000000000000 absDivMod: 4000000) = #(2250000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1457
     self assert:(-9000000000000000000 absDivMod: 4000000) = #(2250000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1458
     self assert:(9000000000000000000 absDivMod: -4000000) = #(2250000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1459
     self assert:(-9000000000000000000 absDivMod: -4000000) = #(2250000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1460
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1461
     self assert:(9000000000000000000 absDivMod: 40000000) = #(225000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1462
     self assert:(-9000000000000000000 absDivMod: 40000000) = #(225000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1463
     self assert:(9000000000000000000 absDivMod: -40000000) = #(225000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1464
     self assert:(-9000000000000000000 absDivMod: -40000000) = #(225000000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1465
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1466
     self assert:(9000000000000000000 absDivMod: 400000000) = #(22500000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1467
     self assert:(-9000000000000000000 absDivMod: 400000000) = #(22500000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1468
     self assert:(9000000000000000000 absDivMod: -400000000) = #(22500000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1469
     self assert:(-9000000000000000000 absDivMod: -400000000) = #(22500000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1470
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1471
     self assert:(9000000000000000000 absDivMod: 4000000000) = #(2250000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1472
     self assert:(-9000000000000000000 absDivMod: 4000000000) = #(2250000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1473
     self assert:(9000000000000000000 absDivMod: -4000000000) = #(2250000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1474
     self assert:(-9000000000000000000 absDivMod: -4000000000) = #(2250000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1475
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1476
     self assert:(9000000000000000000 absDivMod: 40000000000) = #(225000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1477
     self assert:(-9000000000000000000 absDivMod: 40000000000) = #(225000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1478
     self assert:(9000000000000000000 absDivMod: -40000000000) = #(225000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1479
     self assert:(-9000000000000000000 absDivMod: -40000000000) = #(225000000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1480
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1481
     self assert:(9000000000000000000 absDivMod: 400000000000) = #(22500000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1482
     self assert:(-9000000000000000000 absDivMod: 400000000000) = #(22500000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1483
     self assert:(9000000000000000000 absDivMod: -400000000000) = #(22500000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1484
     self assert:(-9000000000000000000 absDivMod: -400000000000) = #(22500000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1485
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1486
     self assert:(9000000000000000000 absDivMod: 4000000000000) = #(2250000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1487
     self assert:(-9000000000000000000 absDivMod: 4000000000000) = #(2250000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1488
     self assert:(9000000000000000000 absDivMod: -4000000000000) = #(2250000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1489
     self assert:(-9000000000000000000 absDivMod: -4000000000000) = #(2250000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1490
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1491
     self assert:(9000000000000000000 absDivMod: 40000000000000) = #(225000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1492
     self assert:(-9000000000000000000 absDivMod: 40000000000000) = #(225000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1493
     self assert:(9000000000000000000 absDivMod: -40000000000000) = #(225000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1494
     self assert:(-9000000000000000000 absDivMod: -40000000000000) = #(225000 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1495
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1496
     self assert:(9000000000000000000 absDivMod: 400000000000000) = #(22500 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1497
     self assert:(-9000000000000000000 absDivMod: 400000000000000) = #(22500 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1498
     self assert:(9000000000000000000 absDivMod: -400000000000000) = #(22500 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1499
     self assert:(-9000000000000000000 absDivMod: -400000000000000) = #(22500 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1500
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1501
     self assert:(9000000000000000000 absDivMod: 4000000000000000) = #(2250 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1502
     self assert:(-9000000000000000000 absDivMod: 4000000000000000) = #(2250 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1503
     self assert:(9000000000000000000 absDivMod: -4000000000000000) = #(2250 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1504
     self assert:(-9000000000000000000 absDivMod: -4000000000000000) = #(2250 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1505
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1506
     self assert:(9000000000000000000 absDivMod: 4000000000000000000) = #(2 1000000000000000000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1507
     self assert:(-9000000000000000000 absDivMod: 4000000000000000000) = #(2 1000000000000000000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1508
     self assert:(9000000000000000000 absDivMod: -4000000000000000000) = #(2 1000000000000000000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1509
     self assert:(-9000000000000000000 absDivMod: -4000000000000000000) = #(2 1000000000000000000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1510
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1511
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1512
     self basicNew testLargeIntegerHelpers3
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1513
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1514
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1515
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1516
testLargeIntegerHelpers4
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1517
    "/ absDivMod:
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1518
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1519
     self assert:(9000000000000000000 absMod: 4000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1520
     self assert:(-9000000000000000000 absMod: 4000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1521
     self assert:(9000000000000000000 absMod: -4000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1522
     self assert:(-9000000000000000000 absMod: -4000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1523
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1524
     self assert:(9000000000000000001 absMod: 4000) = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1525
     self assert:(-9000000000000000001 absMod: 4000) = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1526
     self assert:(9000000000000000001 absMod: -4000) = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1527
     self assert:(-9000000000000000001 absMod: -4000) = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1528
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1529
     self assert:(9000000000000000000 absMod: 40000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1530
     self assert:(-9000000000000000000 absMod: 40000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1531
     self assert:(9000000000000000000 absMod: -40000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1532
     self assert:(-9000000000000000000 absMod: -40000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1533
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1534
     self assert:(9000000000000000000 absMod: 400000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1535
     self assert:(-9000000000000000000 absMod: 400000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1536
     self assert:(9000000000000000000 absMod: -400000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1537
     self assert:(-9000000000000000000 absMod: -400000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1538
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1539
     self assert:(9000000000000000000 absMod: 4000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1540
     self assert:(-9000000000000000000 absMod: 4000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1541
     self assert:(9000000000000000000 absMod: -4000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1542
     self assert:(-9000000000000000000 absMod: -4000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1543
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1544
     self assert:(9000000000000000000 absMod: 40000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1545
     self assert:(-9000000000000000000 absMod: 40000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1546
     self assert:(9000000000000000000 absMod: -40000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1547
     self assert:(-9000000000000000000 absMod: -40000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1548
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1549
     self assert:(9000000000000000000 absMod: 400000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1550
     self assert:(-9000000000000000000 absMod: 400000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1551
     self assert:(9000000000000000000 absMod: -400000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1552
     self assert:(-9000000000000000000 absMod: -400000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1553
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1554
     self assert:(9000000000000000000 absMod: 4000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1555
     self assert:(-9000000000000000000 absMod: 4000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1556
     self assert:(9000000000000000000 absMod: -4000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1557
     self assert:(-9000000000000000000 absMod: -4000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1558
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1559
     self assert:(9000000000000000000 absMod: 40000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1560
     self assert:(-9000000000000000000 absMod: 40000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1561
     self assert:(9000000000000000000 absMod: -40000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1562
     self assert:(-9000000000000000000 absMod: -40000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1563
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1564
     self assert:(9000000000000000000 absMod: 400000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1565
     self assert:(-9000000000000000000 absMod: 400000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1566
     self assert:(9000000000000000000 absMod: -400000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1567
     self assert:(-9000000000000000000 absMod: -400000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1568
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1569
     self assert:(9000000000000000000 absMod: 4000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1570
     self assert:(-9000000000000000000 absMod: 4000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1571
     self assert:(9000000000000000000 absMod: -4000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1572
     self assert:(-9000000000000000000 absMod: -4000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1573
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1574
     self assert:(9000000000000000000 absMod: 40000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1575
     self assert:(-9000000000000000000 absMod: 40000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1576
     self assert:(9000000000000000000 absMod: -40000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1577
     self assert:(-9000000000000000000 absMod: -40000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1578
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1579
     self assert:(9000000000000000000 absMod: 400000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1580
     self assert:(-9000000000000000000 absMod: 400000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1581
     self assert:(9000000000000000000 absMod: -400000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1582
     self assert:(-9000000000000000000 absMod: -400000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1583
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1584
     self assert:(9000000000000000000 absMod: 4000000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1585
     self assert:(-9000000000000000000 absMod: 4000000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1586
     self assert:(9000000000000000000 absMod: -4000000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1587
     self assert:(-9000000000000000000 absMod: -4000000000000000) = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1588
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1589
     self assert:(9000000000000000000 absMod: 4000000000000000000) = 1000000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1590
     self assert:(-9000000000000000000 absMod: 4000000000000000000) = 1000000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1591
     self assert:(9000000000000000000 absMod: -4000000000000000000) = 1000000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1592
     self assert:(-9000000000000000000 absMod: -4000000000000000000) = 1000000000000000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1593
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1594
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1595
     self basicNew testLargeIntegerHelpers4
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1596
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1597
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1598
    "Created: / 05-07-2017 / 16:15:30 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1599
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1600
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1601
testMiscMath
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1602
    self assert:(2 raisedTo:2) == 4.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1603
    self assert:(2 raisedTo:2.0) = 4.0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1604
    self assert:(2 raisedTo:100) = 1267650600228229401496703205376.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1605
    
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1606
    self assert:(((2 raisedTo:100) log:2) isAlmostEqualTo:100 nEpsilon:1) 
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1607
         message:('(2^100)log2 is %1' bindWith:((2 raisedTo:100) log:2)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1608
    self assert:(((2 raisedTo:100) integerLog2) == 100)
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1609
         message:('(2^100)integerLog2 is %1' bindWith:((2 raisedTo:100) integerLog2)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1610
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1611
    self assert:(((10 raisedTo:100) integerLog10) == 100)
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1612
         message:('(10^100)integerLog10 is %1' bindWith:((10 raisedTo:100) integerLog10)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1613
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1614
    "/ currently, integerLog10 does not work with largeInts
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1615
    "/ self assert:(((10 raisedTo:1000) integerLog10) == 1000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1616
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1617
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1618
     self basicNew testMiscMath
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1619
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1620
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1621
    "Created: / 02-07-2017 / 00:52:25 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1622
    "Modified (comment): / 02-07-2017 / 14:39:26 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1623
    "Modified: / 22-07-2019 / 12:44:41 / Claus Gittinger"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1624
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1625
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1626
testMiscMath2
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1627
    self assert:(10000000000000000000000001 isPrime) not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1628
    self assert:(76 factorial + 1) isPrime not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1629
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1630
    "/ Would take far too long with fallback implementation.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1631
    PrimeNumberGenerator notNil ifTrue:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1632
        self assert:(77 factorial + 1) isPrime.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1633
        self assert:(872 factorial + 1) isPrime.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1634
        self assert:(1000 factorial + 1) isPrime not.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1635
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1636
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1637
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1638
    Time millisecondsToRun:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1639
        1000000 factorial.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1640
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1641
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1642
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1643
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1644
     self basicNew testMiscMath2
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1645
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1646
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1647
    "Created: / 05-07-2017 / 16:18:54 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1648
    "Modified (comment): / 26-07-2017 / 12:48:11 / mawalch"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1649
! !
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1650
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1651
!IntegerTest methodsFor:'tests-arithmetic'!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1652
1307
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  1653
testDivision1
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1654
    |a b op rslt|
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1655
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1656
    "/ 10 divMod:3       -> #(3 1)   because 3*3 + 1 = 10
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1657
    "/ 10 divMod:-3      -> #(-4 -2) because -4*-3 + (-2) = 10
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1658
    "/ -10 divMod:3      -> #(-4 2)  because -4*3 + 3 = -10   
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1659
    "/ -10 divMod:-3     -> #(3 -1)  because -3*3 + (-1) = -10
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1660
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1661
    #(
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1662
        ((10 3)      // 3            )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1663
        ((10 -3)     // -4           )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1664
        ((-10 3)     // -4           )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1665
        ((-10 -3)    // 3            )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1666
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1667
        ((10 3)      \\ 1            )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1668
        ((10 -3)     \\ -2           )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1669
        ((-10 3)     \\ 2            )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1670
        ((-10 -3)    \\ -1           )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1671
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1672
        ((10 3)      divMod: (3 1)   )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1673
        ((10 -3)     divMod: (-4 -2) )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1674
        ((-10 3)     divMod: (-4 2)  )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1675
        ((-10 -3)    divMod: (3 -1)  )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1676
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1677
        ((100000000000000000000 3)      // 33333333333333333333            )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1678
        ((100000000000000000000 -3)     // -33333333333333333334           )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1679
        ((-100000000000000000000 3)     // -33333333333333333334           )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1680
        ((-100000000000000000000 -3)    // 33333333333333333333            )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1681
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1682
        ((100000000000000000000 3)      \\ 1            )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1683
        ((100000000000000000000 -3)     \\ -2           )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1684
        ((-100000000000000000000 3)     \\ 2            )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1685
        ((-100000000000000000000 -3)    \\ -1           )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1686
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1687
        ((100000000000000000000 3)      divMod: (33333333333333333333 1)   )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1688
        ((100000000000000000000 -3)     divMod: (-33333333333333333334 -2) )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1689
        ((-100000000000000000000 3)     divMod: (-33333333333333333334 2)  )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1690
        ((-100000000000000000000 -3)    divMod: (33333333333333333333 -1)  )
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1691
    ) do:[:each |
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1692
        |inValues rcvr arg op expectedRslt gotRslt|
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1693
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1694
        inValues := each first.
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1695
        op := each second.
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1696
        expectedRslt := each third.
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1697
        rcvr := inValues first.
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1698
        arg := inValues second.
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1699
        gotRslt := rcvr perform:op with:arg.
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1700
        self 
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1701
            assert:(gotRslt = expectedRslt) 
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1702
            description:('%1 %2 %3 - expected:%4 got:%5' 
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1703
                            bindWith:rcvr with:op with:arg
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1704
                            with:expectedRslt with:gotRslt).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1705
    ].
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1706
        
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1707
    op := #//.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1708
    a := -1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1709
    b := 8.
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1710
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1711
    "/ to check for both compiler-constant folded and actually computed
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1712
    "/ values, these checks are done also with #perform.
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1713
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1714
    self assert:(-1 // 8 == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1715
    self assert:(a // 8 == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1716
    self assert:(-1 // b == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1717
    self assert:(a // b == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1718
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1719
    self assert:((rslt := -1 perform:op with: 8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1720
    self assert:((rslt := a perform:op with: 8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1721
    self assert:((rslt := -1 perform:op with: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1722
    self assert:((rslt := a perform:op with: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1723
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1724
    self assert:((rslt := -1 perform:#// with: 8) == -1).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1725
    self assert:((rslt := a perform:#// with: 8) == -1).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1726
    self assert:((rslt := -1 perform:#// with: b) == -1).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1727
    self assert:((rslt := a perform:#// with: b) == -1).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1728
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1729
    a := 1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1730
    b := -8.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1731
    self assert:(1 // -8 == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1732
    self assert:(a // -8 == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1733
    self assert:(1 // b == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1734
    self assert:(a // b == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1735
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1736
    self assert:((rslt := 1 perform:op with: -8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1737
    self assert:((rslt := a perform:op with: -8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1738
    self assert:((rslt := 1 perform:op with: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1739
    self assert:((rslt := a perform:op with: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1740
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1741
    self assert:((rslt := 1 perform:#// with: -8) == -1).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1742
    self assert:((rslt := a perform:#// with: -8) == -1).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1743
    self assert:((rslt := 1 perform:#// with: b) == -1).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1744
    self assert:((rslt := a perform:#// with: b) == -1).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1745
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1746
    a := -1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1747
    b := -8.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1748
    self assert:(-1 // -8 == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1749
    self assert:(a // -8 == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1750
    self assert:(-1 // b == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1751
    self assert:(a // b == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1752
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1753
    self assert:((rslt := -1 perform:op with: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1754
    self assert:((rslt := a perform:op with: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1755
    self assert:((rslt := -1 perform:op with: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1756
    self assert:((rslt := a perform:op with: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1757
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1758
    self assert:((rslt := -1 perform:#// with: -8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1759
    self assert:((rslt := a perform:#// with: -8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1760
    self assert:((rslt := -1 perform:#// with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1761
    self assert:((rslt := a perform:#// with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1762
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1763
    a := 1.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1764
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1765
    self assert:(1 // 8 == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1766
    self assert:(a // 8 == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1767
    self assert:(1 // b == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1768
    self assert:(a // b == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1769
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1770
    self assert:((rslt := 1 perform:op with: 8) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1771
    self assert:((rslt := a perform:op with: 8) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1772
    self assert:((rslt := 1 perform:op with: b) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1773
    self assert:((rslt := a perform:op with: b) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1774
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1775
    self assert:((rslt := 1 perform:#// with: 8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1776
    self assert:((rslt := a perform:#// with: 8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1777
    self assert:((rslt := 1 perform:#// with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1778
    self assert:((rslt := a perform:#// with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1779
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1780
    a := -16.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1781
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1782
    self assert:(-16 // 8 == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1783
    self assert:(a // 8 == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1784
    self assert:(-16 // b == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1785
    self assert:(a // b == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1786
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1787
    self assert:((rslt := -16 perform:op with: 8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1788
    self assert:((rslt := a perform:op with: 8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1789
    self assert:((rslt := -16 perform:op with: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1790
    self assert:((rslt := a perform:op with: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1791
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1792
    self assert:((rslt := -16 perform:#// with: 8) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1793
    self assert:((rslt := a perform:#// with: 8) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1794
    self assert:((rslt := -16 perform:#// with: b) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1795
    self assert:((rslt := a perform:#// with: b) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1796
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1797
    a := 16.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1798
    b := -8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1799
    self assert:(16 // -8 == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1800
    self assert:(a // -8 == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1801
    self assert:(16 // b == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1802
    self assert:(a // b == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1803
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1804
    self assert:((rslt := 16 perform:op with: -8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1805
    self assert:((rslt := a perform:op with: -8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1806
    self assert:((rslt := 16 perform:op with: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1807
    self assert:((rslt := a perform:op with: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1808
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1809
    self assert:((rslt := 16 perform:#// with: -8) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1810
    self assert:((rslt := a perform:#// with: -8) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1811
    self assert:((rslt := 16 perform:#// with: b) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1812
    self assert:((rslt := a perform:#// with: b) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1813
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1814
    a := -16.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1815
    b := -8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1816
    self assert:(-16 // -8 == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1817
    self assert:(a // -8 == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1818
    self assert:(-16 // b == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1819
    self assert:(a // b == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1820
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1821
    self assert:((rslt := -16 perform:op with: -8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1822
    self assert:((rslt := a perform:op with: -8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1823
    self assert:((rslt := -16 perform:op with: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1824
    self assert:((rslt := a perform:op with: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1825
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1826
    self assert:((rslt := -16 perform:#// with: -8) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1827
    self assert:((rslt := a perform:#// with: -8) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1828
    self assert:((rslt := -16 perform:#// with: b) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1829
    self assert:((rslt := a perform:#// with: b) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1830
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1831
    a := 16.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1832
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1833
    self assert:(16 // 8 == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1834
    self assert:(a // 8 == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1835
    self assert:(16 // b == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1836
    self assert:(a // b == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1837
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1838
    self assert:((rslt := 16 perform:op with: 8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1839
    self assert:((rslt := a perform:op with: 8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1840
    self assert:((rslt := 16 perform:op with: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1841
    self assert:((rslt := a perform:op with: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1842
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1843
    self assert:((rslt := 16 perform:#// with: 8) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1844
    self assert:((rslt := a perform:#// with: 8) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1845
    self assert:((rslt := 16 perform:#// with: b) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1846
    self assert:((rslt := a perform:#// with: b) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1847
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1848
    op := #quo:.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1849
    a := -1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1850
    b := 8.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1851
    self assert:((rslt := -1 quo: 8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1852
    self assert:((rslt := a quo: 8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1853
    self assert:((rslt := -1 quo: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1854
    self assert:((rslt := a quo: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1855
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1856
    self assert:((rslt := -1 perform:op with: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1857
    self assert:((rslt := a perform:op with: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1858
    self assert:((rslt := -1 perform:op with: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1859
    self assert:((rslt := a perform:op with: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1860
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1861
    self assert:((rslt := -1 perform:#quo: with: -8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1862
    self assert:((rslt := a perform:#quo: with: -8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1863
    self assert:((rslt := -1 perform:#quo: with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1864
    self assert:((rslt := a perform:#quo: with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1865
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1866
    a := 1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1867
    b := -8.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1868
    self assert:((rslt := 1 quo: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1869
    self assert:((rslt := a quo: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1870
    self assert:((rslt := 1 quo: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1871
    self assert:((rslt := a quo: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1872
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1873
    self assert:((rslt := 1 perform:op with: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1874
    self assert:((rslt := a perform:op with: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1875
    self assert:((rslt := 1 perform:op with: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1876
    self assert:((rslt := a perform:op with: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1877
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1878
    self assert:((rslt := 1 perform:#quo: with: -8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1879
    self assert:((rslt := a perform:#quo: with: -8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1880
    self assert:((rslt := 1 perform:#quo: with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1881
    self assert:((rslt := a perform:#quo: with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1882
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1883
    a := -1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1884
    b := -8.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1885
    self assert:((rslt := -1 quo: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1886
    self assert:((rslt := a quo: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1887
    self assert:((rslt := -1 quo: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1888
    self assert:((rslt := a quo: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1889
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1890
    self assert:((rslt := -1 perform:op with: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1891
    self assert:((rslt := a perform:op with: -8) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1892
    self assert:((rslt := -1 perform:op with: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1893
    self assert:((rslt := a perform:op with: b) == 0).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1894
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1895
    self assert:((rslt := -1 perform:#quo: with: -8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1896
    self assert:((rslt := a perform:#quo: with: -8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1897
    self assert:((rslt := -1 perform:#quo: with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1898
    self assert:((rslt := a perform:#quo: with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1899
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1900
    a := 1.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1901
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1902
    self assert:((rslt := 1 quo: 8) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1903
    self assert:((rslt := a quo: 8) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1904
    self assert:((rslt := 1 quo: b) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1905
    self assert:((rslt := a quo: b) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1906
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1907
    self assert:((rslt := 1 perform:op with: 8) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1908
    self assert:((rslt := a perform:op with: 8) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1909
    self assert:((rslt := 1 perform:op with: b) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1910
    self assert:((rslt := a perform:op with: b) == 0).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1911
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1912
    self assert:((rslt := 1 perform:#quo: with: 8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1913
    self assert:((rslt := a perform:#quo: with: 8) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1914
    self assert:((rslt := 1 perform:#quo: with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1915
    self assert:((rslt := a perform:#quo: with: b) == 0).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1916
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1917
    a := -16.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1918
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1919
    self assert:((rslt := -16 quo: 8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1920
    self assert:((rslt := a quo: 8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1921
    self assert:((rslt := -16 quo: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1922
    self assert:((rslt := a quo: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1923
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1924
    self assert:((rslt := -16 perform:op with: 8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1925
    self assert:((rslt := a perform:op with: 8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1926
    self assert:((rslt := -16 perform:op with: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1927
    self assert:((rslt := a perform:op with: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1928
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1929
    self assert:((rslt := -16 perform:#quo: with: 8) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1930
    self assert:((rslt := a perform:#quo: with: 8) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1931
    self assert:((rslt := -16 perform:#quo: with: b) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1932
    self assert:((rslt := a perform:#quo: with: b) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1933
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1934
    a := 16.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1935
    b := -8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1936
    self assert:((rslt := 16 quo: -8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1937
    self assert:((rslt := a quo: -8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1938
    self assert:((rslt := 16 quo: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1939
    self assert:((rslt := a quo: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1940
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1941
    self assert:((rslt := 16 perform:op with: -8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1942
    self assert:((rslt := a perform:op with: -8) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1943
    self assert:((rslt := 16 perform:op with: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1944
    self assert:((rslt := a perform:op with: b) == -2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1945
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1946
    self assert:((rslt := 16 perform:#quo: with: -8) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1947
    self assert:((rslt := a perform:#quo: with: -8) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1948
    self assert:((rslt := 16 perform:#quo: with: b) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1949
    self assert:((rslt := a perform:#quo: with: b) == -2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1950
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1951
    a := -16.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1952
    b := -8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1953
    self assert:((rslt := -16 quo: -8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1954
    self assert:((rslt := a quo: -8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1955
    self assert:((rslt := -16 quo: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1956
    self assert:((rslt := a quo: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1957
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1958
    self assert:((rslt := -16 perform:op with: -8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1959
    self assert:((rslt := a perform:op with: -8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1960
    self assert:((rslt := -16 perform:op with: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1961
    self assert:((rslt := a perform:op with: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1962
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1963
    self assert:((rslt := -16 perform:#quo: with: -8) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1964
    self assert:((rslt := a perform:#quo: with: -8) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1965
    self assert:((rslt := -16 perform:#quo: with: b) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1966
    self assert:((rslt := a perform:#quo: with: b) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1967
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1968
    a := 16.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1969
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1970
    self assert:((rslt := 16 quo: 8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1971
    self assert:((rslt := a quo: 8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1972
    self assert:((rslt := 16 quo: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1973
    self assert:((rslt := a quo: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1974
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1975
    self assert:((rslt := 16 perform:op with: 8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1976
    self assert:((rslt := a perform:op with: 8) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1977
    self assert:((rslt := 16 perform:op with: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1978
    self assert:((rslt := a perform:op with: b) == 2).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1979
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1980
    self assert:((rslt := 16 perform:#quo: with: 8) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1981
    self assert:((rslt := a perform:#quo: with: 8) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1982
    self assert:((rslt := 16 perform:#quo: with: b) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1983
    self assert:((rslt := a perform:#quo: with: b) == 2).
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  1984
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1985
    "
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1986
     self basicNew testDivision
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1987
    "
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1988
!
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  1989
1307
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  1990
testDivision2
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  1991
    |nr|
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  1992
    
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  1993
    2 to:17 do:[:m |
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  1994
        nr := 1.
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  1995
        1 to:1000 do:[:n |
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  1996
            nr := nr * m
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  1997
        ].
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  1998
        1 to:1000 do:[:n |
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  1999
            nr := nr / m
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2000
        ].
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2001
        self assert:(nr == 1).
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2002
    ].
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2003
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2004
    "
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2005
     self new testDivision2
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2006
    "
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2007
!
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2008
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2009
testDivision3
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2010
    |nr|
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2011
    
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2012
    #( 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2013
        16r00000000000000003F 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2014
        16r000000000000003FFF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2015
        16r0000000000003FFFFF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2016
        16r00000000003FFFFFFF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2017
        16r000000003FFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2018
        16r0000003FFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2019
        16r00003FFFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2020
        16r003FFFFFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2021
        16r3FFFFFFFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2022
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2023
        16r000000000000000040 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2024
        16r0000000000000040FF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2025
        16r00000000000040FFFF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2026
        16r000000000040FFFFFF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2027
        16r0000000040FFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2028
        16r00000040FFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2029
        16r000040FFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2030
        16r0040FFFFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2031
        16r40FFFFFFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2032
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2033
        16r00000000000000007F 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2034
        16r000000000000007FFF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2035
        16r0000000000007FFFFF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2036
        16r00000000007FFFFFFF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2037
        16r000000007FFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2038
        16r0000007FFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2039
        16r00007FFFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2040
        16r007FFFFFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2041
        16r7FFFFFFFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2042
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2043
        16r0000000000000000FF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2044
        16r00000000000000FFFF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2045
        16r000000000000FFFFFF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2046
        16r0000000000FFFFFFFF 
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2047
        16r00000000FFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2048
        16r000000FFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2049
        16r0000FFFFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2050
        16r00FFFFFFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2051
        16rFFFFFFFFFFFFFFFFFF
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2052
    ) do:[:m |
1365
c3b631cb0688 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1323
diff changeset
  2053
        "/ Transcript showCR:m.
1307
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2054
        nr := 1.
1313
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2055
        1 to:100 do:[:n |
1307
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2056
            nr := nr * m
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2057
        ].
1313
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2058
        1 to:100 do:[:n |
1307
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2059
            nr := nr / m
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2060
        ].
1365
c3b631cb0688 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1323
diff changeset
  2061
        self assert:(nr == 1) description:('failed in division of ',m printString).
1307
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2062
    ].
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2063
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2064
    "
1313
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2065
     self new testDivision3
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2066
     Time millisecondsToRun:[ self new testDivision3 ] 14440
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2067
     MessageTally spyOn:[ self new testDivision3 ] 
1307
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2068
    "
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2069
!
f2b5a843d7df #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
  2070
1320
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2071
testDivision4
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2072
    "boundary conditions, wehre smallInts should be returned"
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2073
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2074
    |n1 n2 r|
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2075
    
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2076
    n1 := 1152921504606846976.  "/ 16r1000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2077
    n2 := -1073741824.          "/ 16r40000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2078
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2079
    self assert:(r = -1073741824).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2080
    self assert:(r class == SmallInteger).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2081
    self assert:(r == -1073741824).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2082
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2083
    n1 := 1152921504606846976.  "/ 16r1000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2084
    n2 := 1073741824.           "/ 16r40000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2085
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2086
    self assert:(r = 1073741824).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2087
    SmallInteger maxBytes == 8 ifTrue:[
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2088
        self assert:(r class == SmallInteger).
1322
6925e7f2eaf3 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1320
diff changeset
  2089
        self assert:(r == 1073741824).
1320
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2090
    ].
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2091
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2092
    n1 := 1152921504606846976.  "/ 16r1000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2093
    n2 := -536870912.           "/ 16r20000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2094
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2095
    self assert:(r = -2147483648).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2096
    SmallInteger maxBytes == 8 ifTrue:[
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2097
        self assert:(r class == SmallInteger).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2098
        self assert:(r == -2147483648).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2099
    ].
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2100
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2101
    n1 := 1152921504606846976.  "/ 16r1000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2102
    n2 := 536870912.            "/ 16r20000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2103
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2104
    self assert:(r = 2147483648).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2105
    SmallInteger maxBytes == 8 ifTrue:[
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2106
        self assert:(r class == SmallInteger).
1322
6925e7f2eaf3 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1320
diff changeset
  2107
        self assert:(r == 2147483648).
1320
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2108
    ].
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2109
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2110
    n1 := 1152921504606846976.  "/ 16r1000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2111
    n2 := -2147483648.          "/ 16r80000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2112
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2113
    self assert:(r = -536870912).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2114
    self assert:(r class == SmallInteger).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2115
    self assert:(r == -536870912).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2116
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2117
    n1 := 1152921504606846976.  "/ 16r1000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2118
    n2 := 2147483648.           "/ 16r80000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2119
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2120
    self assert:(r = 536870912).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2121
    self assert:(r class == SmallInteger).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2122
    self assert:(r == 536870912).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2123
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2124
    n1 := 21267647932558653966460912964485513216.  "/ 16r10000000000000000000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2125
    n2 := -4611686018427387904.                    "/ 16r4000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2126
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2127
    self assert:(r = -4611686018427387904).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2128
    SmallInteger maxBytes == 8 ifTrue:[
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2129
        self assert:(r class == SmallInteger).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2130
        self assert:(r == -4611686018427387904).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2131
    ].
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2132
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2133
    n1 := 21267647932558653966460912964485513216.  "/ 16r10000000000000000000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2134
    n2 := 4611686018427387904.                     "/ 16r4000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2135
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2136
    self assert:(r = 4611686018427387904).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2137
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2138
    n1 := 21267647932558653966460912964485513216.  "/ 16r10000000000000000000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2139
    n2 := -2305843009213693952.                    "/ 16r2000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2140
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2141
    self assert:(r = -9223372036854775808).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2142
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2143
    n1 := 21267647932558653966460912964485513216.  "/ 16r10000000000000000000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2144
    n2 := 2305843009213693952.                     "/ 16r2000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2145
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2146
    self assert:(r = 9223372036854775808).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2147
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2148
    n1 := 21267647932558653966460912964485513216.  "/ 16r10000000000000000000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2149
    n2 := -9223372036854775808.                    "/ 16r8000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2150
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2151
    self assert:(r = -2305843009213693952).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2152
    SmallInteger maxBytes == 8 ifTrue:[
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2153
        self assert:(r class == SmallInteger).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2154
        self assert:(r == -2305843009213693952).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2155
    ].
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2156
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2157
    n1 := 21267647932558653966460912964485513216.  "/ 16r10000000000000000000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2158
    n2 := 9223372036854775808.                     "/ 16r8000000000000000
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2159
    r := n1 / n2.
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2160
    self assert:(r = 2305843009213693952).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2161
    SmallInteger maxBytes == 8 ifTrue:[
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2162
        self assert:(r class == SmallInteger).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2163
        self assert:(r == 2305843009213693952).
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2164
    ].
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2165
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2166
    "
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2167
     self new testDivision4
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2168
    "
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2169
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2170
    "Created: / 26-02-2016 / 20:21:47 / cg"
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2171
!
c591f48b955d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1319
diff changeset
  2172
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2173
testLargeAddition
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2174
    "general conversion & arithmetic tests.
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2175
     Notice, the arithmetic tests are both performed via regular sends
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2176
     and via constructed performs. The reason is to test both inlined
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2177
     JIT-compiler code AND the regular methods code."
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2178
23
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2179
    "Large + Large addition"
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2180
    self testReading1.
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2181
1315
624d2643334a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2182
    self assert:(20 factorial = 2432902008176640000).
624d2643334a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2183
    self assert:(20 factorial printString = '2432902008176640000').
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2184
    self assert:((20 factorial + 20 factorial) printString = '4865804016353280000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2185
    self assert:((20 factorial + 1) printString = '2432902008176640001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2186
    self assert:((20 factorial + 1000) printString = '2432902008176641000').
23
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2187
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2188
    "Large + Small addition"
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2189
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2190
    self testLargeAddition1.
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2191
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2192
    "Large + Large addition"
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2193
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2194
    self testLargeAddition2.
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2195
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2196
    "Large - small subtraction"
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2197
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2198
    self testLargeAddition3.
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2199
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2200
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2201
     self basicNew testLargeAddition
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2202
    "
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2203
1315
624d2643334a #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
  2204
    "Modified: / 26-02-2016 / 15:39:33 / cg"
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2205
!
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2206
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2207
testLargeAddition1
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2208
    "general conversion & arithmetic tests.
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2209
     Notice, the arithmetic tests are both performed via regular sends
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2210
     and via constructed performs. The reason is to test both inlined
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2211
     JIT-compiler code AND the regular methods code."
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2212
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  2213
    |n1 n2|
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2214
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2215
    "Large + Small addition"
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2216
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2217
    n1 := 16r3FFFFFFF. n2 := 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2218
    self assert:((n1 + n2 ) hexPrintString = '40000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2219
    self assert:((n1 perform:'+' asSymbol with:n2 ) hexPrintString = '40000000').
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2220
    n1 := 16r3FFFFFFFF. n2 := 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2221
    self assert:((n1 + n2 ) hexPrintString = '400000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2222
    self assert:((n1 perform:'+' asSymbol with:n2 ) hexPrintString = '400000000').
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2223
    n1 := 16r3FFFFFFFFF. n2 := 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2224
    self assert:((n1 + n2 ) hexPrintString = '4000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2225
    self assert:((n1 perform:'+' asSymbol with:n2 ) hexPrintString = '4000000000').
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2226
    n1 := 16r3FFFFFFFFFF. n2 := 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2227
    self assert:((n1 + n2 ) hexPrintString = '40000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2228
    self assert:((n1 perform:'+' asSymbol with:n2 ) hexPrintString = '40000000000').
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2229
    n1 := 16r3FFFFFFFFFFF. n2 := 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2230
    self assert:((n1 + n2 ) hexPrintString = '400000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2231
    self assert:((n1 perform:'+' asSymbol with:n2 ) hexPrintString = '400000000000').
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2232
    n1 := 16r3FFFFFFFFFFFF. n2 := 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2233
    self assert:((n1 + n2 ) hexPrintString = '4000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2234
    self assert:((n1 perform:'+' asSymbol with:n2 ) hexPrintString = '4000000000000').
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2235
    n1 := 16r3FFFFFFFFFFFFF. n2 := 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2236
    self assert:((n1 + n2 ) hexPrintString = '40000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2237
    self assert:((n1 perform:'+' asSymbol with:n2 ) hexPrintString = '40000000000000').
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2238
    n1 := 16r3FFFFFFFFFFFFFF. n2 := 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2239
    self assert:((n1 + n2 ) hexPrintString = '400000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2240
    self assert:((n1 perform:'+' asSymbol with:n2 ) hexPrintString = '400000000000000').
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2241
    n1 := 16r3FFFFFFFFFFFFFFF. n2 := 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2242
    self assert:((n1 + n2 ) hexPrintString = '4000000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2243
    self assert:((n1 perform:'+' asSymbol with:n2 ) hexPrintString = '4000000000000000').
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2244
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2245
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2246
     self basicNew testLargeAddition1
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2247
    "
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2248
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2249
    "Modified: / 4.6.1999 / 15:26:55 / cg"
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2250
!
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2251
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2252
testLargeAddition2
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2253
    "general conversion & arithmetic tests.
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2254
     Notice, the arithmetic tests are both performed via regular sends
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2255
     and via constructed performs. The reason is to test both inlined
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2256
     JIT-compiler code AND the regular methods code."
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2257
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  2258
    |n1 n2 x|
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2259
29
cedaa7d102d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 28
diff changeset
  2260
    "Large + Large addition"
23
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2261
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2262
    n1 := 16r100000000. n2 := 16r7FFFFFFF.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2263
    self assert:((n1 - n2 ) hexPrintString = '80000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2264
    self assert:((16r100000000 - n2 ) hexPrintString = '80000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2265
    self assert:((n1 - 16r7FFFFFFF ) hexPrintString = '80000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2266
    self assert:((16r100000000 - 16r7FFFFFFF ) hexPrintString = '80000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2267
    self assert:((n1 perform:'-' asSymbol with:n2 ) hexPrintString = '80000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2268
    self assert:((16r100000000 perform:'-' asSymbol with:n2 ) hexPrintString = '80000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2269
    self assert:((n1 perform:'-' asSymbol with:16r7FFFFFFF ) hexPrintString = '80000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2270
    self assert:((16r100000000 perform:'-' asSymbol with:16r7FFFFFFF ) hexPrintString = '80000001').
23
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2271
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2272
    n1 := 16r100000000. n2 := 16r80000000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2273
    self assert:((n1 - n2 ) hexPrintString = '80000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2274
    self assert:((16r100000000 - n2 ) hexPrintString = '80000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2275
    self assert:((n1 - 16r80000000 ) hexPrintString = '80000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2276
    self assert:((16r100000000 - 16r80000000 ) hexPrintString = '80000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2277
    self assert:((n1 perform:'-' asSymbol with:n2 ) hexPrintString = '80000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2278
    self assert:((16r100000000 perform:'-' asSymbol with:n2 ) hexPrintString = '80000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2279
    self assert:((n1 perform:'-' asSymbol with:16r80000000 ) hexPrintString = '80000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2280
    self assert:((16r100000000 perform:'-' asSymbol with:16r80000000 ) hexPrintString = '80000000').
17
2573c1ad19a4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 16
diff changeset
  2281
2573c1ad19a4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 16
diff changeset
  2282
    n1 := 16r100000000. n2 := 16rFFFFFFFF.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2283
    self assert:((n1 - n2 ) hexPrintString = '1').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2284
    self assert:((16r100000000 - n2 ) hexPrintString = '1').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2285
    self assert:((x := n1 - 16rFFFFFFFF) == 1).
17
2573c1ad19a4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 16
diff changeset
  2286
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2287
    self assert:((n1 - 16rFFFFFFFF ) hexPrintString = '1').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2288
    self assert:((16r100000000 - 16rFFFFFFFF ) hexPrintString = '1').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2289
    self assert:((n1 perform:'-' asSymbol with:n2 ) hexPrintString = '1').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2290
    self assert:((16r100000000 perform:'-' asSymbol with:n2 ) hexPrintString = '1').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2291
    self assert:((n1 perform:'-' asSymbol with:16rFFFFFFFF ) hexPrintString = '1').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2292
    self assert:((16r100000000 perform:'-' asSymbol with:16rFFFFFFFF ) hexPrintString = '1').
23
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2293
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2294
    n1 := 16r100000000. n2 := 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2295
    self assert:((n1 - n2) hexPrintString = 'FFFFFFFF').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2296
    self assert:((n1 - n2) hexPrintString = 'FFFFFFFF').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2297
    self assert:((16r100000000 - n2) hexPrintString = 'FFFFFFFF').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2298
    self assert:((n1 - 1) hexPrintString = 'FFFFFFFF').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2299
    self assert:((16r100000000 - 1) hexPrintString = 'FFFFFFFF').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2300
    self assert:((n1 perform:'-' asSymbol with:n2) hexPrintString = 'FFFFFFFF').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2301
    self assert:((16r100000000 perform:'-' asSymbol with:n2) hexPrintString = 'FFFFFFFF').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2302
    self assert:((n1 perform:'-' asSymbol with:1) hexPrintString = 'FFFFFFFF').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2303
    self assert:((16r100000000 perform:'-' asSymbol with:1) hexPrintString = 'FFFFFFFF').
23
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2304
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2305
    n1 := 16r100000000. n2 := 16r10000000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2306
    self assert:((n1 - n2) hexPrintString = 'F0000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2307
    self assert:((16r100000000 - n2) hexPrintString = 'F0000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2308
    self assert:((n1 - 16r10000000) hexPrintString = 'F0000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2309
    self assert:((16r100000000 - 16r10000000) hexPrintString = 'F0000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2310
    self assert:((n1 perform:'-' asSymbol with:n2) hexPrintString = 'F0000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2311
    self assert:((16r100000000 perform:'-' asSymbol with:n2) hexPrintString = 'F0000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2312
    self assert:((n1 perform:'-' asSymbol with:16r10000000) hexPrintString = 'F0000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2313
    self assert:((16r100000000 perform:'-' asSymbol with:16r10000000) hexPrintString = 'F0000000').
23
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2314
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2315
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2316
     self basicNew testLargeAddition2
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2317
    "
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2318
!
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2319
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2320
testLargeAddition3
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2321
    "general conversion & arithmetic tests.
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2322
     Notice, the arithmetic tests are both performed via regular sends
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2323
     and via constructed performs. The reason is to test both inlined
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2324
     JIT-compiler code AND the regular methods code."
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2325
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  2326
    |n1 n2|
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  2327
23
5db5444c09d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 22
diff changeset
  2328
    "Large - small subtraction"
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2329
    self assert:((20 factorial + 20 factorial - 1) printString = '4865804016353279999').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2330
    self assert:((20 factorial - 10 factorial + 3628800) printString = '2432902008176640000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2331
    self assert:((20 factorial - 11 factorial + 39916800) printString = '2432902008176640000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2332
    self assert:((20 factorial - 12 factorial + 479001600) printString = '2432902008176640000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2333
    self assert:((20 factorial - 13 factorial + 6227020800) printString = '2432902008176640000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2334
    self assert:((20 factorial - 14 factorial + 87178291200) printString = '2432902008176640000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2335
    self assert:((20 factorial - 15 factorial + 1307674368000) printString = '2432902008176640000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2336
    self assert:((20 factorial - 16 factorial + 20922789888000) printString = '2432902008176640000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2337
    self assert:((20 factorial + 10 factorial - 3628800) printString = '2432902008176640000').
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2338
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2339
    self assert:(1000 factorial printString = '402387260077093773543702433923003985719374864210714632543799910429938512398629020592044208486969404800479988610197196058631666872994808558901323829669944590997424504087073759918823627727188732519779505950995276120874975462497043601418278094646496291056393887437886487337119181045825783647849977012476632889835955735432513185323958463075557409114262417474349347553428646576611667797396668820291207379143853719588249808126867838374559731746136085379534524221586593201928090878297308431392844403281231558611036976801357304216168747609675871348312025478589320767169132448426236131412508780208000261683151027341827977704784635868170164365024153691398281264810213092761244896359928705114964975419909342221566832572080821333186116811553615836546984046708975602900950537616475847728421889679646244945160765353408198901385442487984959953319101723355556602139450399736280750137837615307127761926849034352625200015888535147331611702103968175921510907788019393178114194545257223865541461062892187960223838971476088506276862967146674697562911234082439208160153780889893964518263243671616762179168909779911903754031274622289988005195444414282012187361745992642956581746628302955570299024324153181617210465832036786906117260158783520751516284225540265170483304226143974286933061690897968482590125458327168226458066526769958652682272807075781391858178889652208164348344825993266043367660176999612831860788386150279465955131156552036093988180612138558600301435694527224206344631797460594682573103790084024432438465657245014402821885252470935190620929023136493273497565513958720559654228749774011413346962715422845862377387538230483865688976461927383814900140767310446640259899490222221765904339901886018566526485061799702356193897017860040811889729918311021171229845901641921068884387121855646124960798722908519296819372388642614839657382291123125024186649353143970137428531926649875337218940694281434118520158014123344828015051399694290153483077644569099073152433278288269864602789864321139083506217095002597389863554277196742822248757586765752344220207573630569498825087968928162753848863396909959826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254742173582401063677404595741785160829230135358081840096996372524230560855903700624271243416909004153690105933983835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000').
51
0e665a7d77ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
  2340
0e665a7d77ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
  2341
    n1 := n2 := 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2342
    self assert:((1000 factorial + n1 - n2) = 1000 factorial).
51
0e665a7d77ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
  2343
    n1 := n2 := 1000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2344
    self assert:((1000 factorial + n1 - n2) = 1000 factorial).
51
0e665a7d77ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
  2345
    n1 := n2 := 16rFFFFFFFF.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2346
    self assert:((1000 factorial + n1 - n2) = 1000 factorial).
51
0e665a7d77ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
  2347
    n1 := n2 := 16rFFFFFFFFFFFF.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2348
    self assert:((1000 factorial + n1 - n2) = 1000 factorial).
51
0e665a7d77ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
  2349
    n1 := n2 := 16rFFFFFFFFFFFFFFFF.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2350
    self assert:((1000 factorial + n1 - n2) = 1000 factorial).
51
0e665a7d77ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
  2351
    n1 := n2 := 1000 factorial.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2352
    self assert:((1000 factorial + n1 - n2) = 1000 factorial).
51
0e665a7d77ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
  2353
0e665a7d77ea checkin from browser
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
  2354
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2355
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2356
     self basicNew testLargeAddition3
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2357
    "
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2358
52
544196f29bee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 51
diff changeset
  2359
    "Modified: / 27.11.1999 / 16:41:54 / cg"
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2360
!
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2361
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2362
testLargeDivision
1786
665a0c69ecb2 #BUGFIX by sr
sr
parents: 1785
diff changeset
  2363
    |t a b|
940
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2364
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2365
    "/ on a 64bit machine, this is actually a smallInteger!!
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2366
    t := 20 factorial.
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2367
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2368
    self assert:(t printString = '2432902008176640000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2369
    self assert:(t \\ 10 == 0).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2370
    t := t // 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2371
    self assert:(t printString = '243290200817664000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2372
    self assert:(t \\ 10 == 0).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2373
    t := t // 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2374
    self assert:(t printString = '24329020081766400').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2375
    self assert:(t \\ 10 == 0).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2376
    t := t // 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2377
    self assert:(t printString = '2432902008176640').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2378
    self assert:(t \\ 10 == 0).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2379
    t := t // 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2380
    self assert:(t printString = '243290200817664').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2381
    self assert:(t \\ 10 == 4).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2382
    t := t // 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2383
    self assert:(t printString = '24329020081766').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2384
    self assert:(t \\ 10 == 6).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2385
    t := t // 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2386
    self assert:(t printString = '2432902008176').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2387
    self assert:(t \\ 10 == 6).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2388
    t := t // 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2389
    self assert:(t printString = '243290200817').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2390
    self assert:(t \\ 10 == 7).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2391
    t := t // 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2392
    self assert:(t printString = '24329020081').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2393
    self assert:(t \\ 10 == 1).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2394
    t := t // 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2395
    self assert:(t printString = '2432902008').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2396
    self assert:(t \\ 10 == 8).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2397
    t := t // 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2398
    self assert:(t printString = '243290200').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2399
    self assert:(t \\ 10 == 0).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2400
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2401
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2402
    t := 20 factorial.
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2403
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2404
    self assert:(t printString = '2432902008176640000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2405
    self assert:(t \\ 1000 == 0).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2406
    t := t // 1000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2407
    self assert:(t printString = '2432902008176640').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2408
    self assert:(t \\ 1000 == 640).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2409
    t := t // 1000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2410
    self assert:(t printString = '2432902008176').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2411
    self assert:(t \\ 1000 == 176).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2412
    t := t // 1000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2413
    self assert:(t printString = '2432902008').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2414
    self assert:(t \\ 1000 == 8).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2415
    t := t // 1000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2416
    self assert:(t printString = '2432902').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2417
    self assert:(t \\ 1000 == 902).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2418
    t := t // 1000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2419
    self assert:(t printString = '2432').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2420
    self assert:(t \\ 1000 == 432).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2421
    t := t // 1000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2422
    self assert:(t == 2).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2423
    self assert:(t \\ 1000 == 2).
16
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2424
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2425
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2426
    t := 20 factorial.
b10bb029410d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 15
diff changeset
  2427
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2428
    "Large // SmallInt division"
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2429
    t := t // 20.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2430
    self assert:(t printString = 19 factorial printString).
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2431
    t := t // 19.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2432
    self assert:(t printString = 18 factorial printString).
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2433
    t := t // 18.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2434
    self assert:(t printString = 17 factorial printString).
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2435
    t := t // 17.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2436
    self assert:(t printString = 16 factorial printString).
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2437
    t := t // 16.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2438
    self assert:(t printString = 15 factorial printString).
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2439
    t := t // 15.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2440
    self assert:(t printString = 14 factorial printString).
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2441
    t := t // 14.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2442
    self assert:(t printString = 13 factorial printString).
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2443
    t := t // 13.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2444
    self assert:(t printString = 12 factorial printString).
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2445
    t := t // 12.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2446
    self assert:(t printString = 11 factorial printString).
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2447
    t := t // 11.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2448
    self assert:(t printString = 10 factorial printString).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2449
    self assert:(t == 10 factorial).
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2450
26
eb5fdf34fb28 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 25
diff changeset
  2451
    t := 20 factorial.
eb5fdf34fb28 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 25
diff changeset
  2452
    t := t + 21 factorial.
1313
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2453
    t absDestructiveSubtract:21 factorial.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2454
    self assert:(t compressed = 20 factorial).
26
eb5fdf34fb28 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 25
diff changeset
  2455
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2456
    self assert:(
1313
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2457
             [
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2458
               |v|
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2459
               v := 100 factorial copy.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2460
               v absDestructiveSubtract:99 factorial.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2461
               v compressed = (100 factorial - 99 factorial).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2462
             ] value).
26
eb5fdf34fb28 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 25
diff changeset
  2463
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2464
    "Large // Large division"
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2465
    self assert:((20 factorial // 19 factorial) == 20).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2466
    self assert:((20 factorial * 21 // 20 // 21) = (19 factorial)).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2467
    self assert:((10000 factorial // 9999 factorial) == 10000).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2468
    self assert:((10000 factorial // 9999 factorial) == (10000 factorial / 9999 factorial)).
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2469
940
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2470
    a := 40 factorial.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2471
    b := 39 factorial.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2472
    self assert:(a // 40 = b).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2473
    self assert:(a / 40 = b).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2474
    self assert:(a // b = 40).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2475
    self assert:(a // b = 40).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2476
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2477
    "
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2478
     self basicNew testLargeDivision
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2479
    "
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2480
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2481
    "Modified: / 4.6.1999 / 23:54:57 / cg"
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2482
!
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2483
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2484
testLargeDivision2
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2485
    |t|
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2486
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2487
    t := 30 factorial.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2488
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2489
    self assert:(t printString = '265252859812191058636308480000000').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2490
    self assert:(t \\ 10 == 0).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2491
    t := t // 10.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2492
    self assert:(t printString = '26525285981219105863630848000000').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2493
    self assert:(t \\ 10 == 0).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2494
    t := t // 10.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2495
    self assert:(t printString = '2652528598121910586363084800000').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2496
    self assert:(t \\ 10 == 0).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2497
    t := t // 10.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2498
    self assert:(t printString = '265252859812191058636308480000').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2499
    self assert:(t \\ 10 == 0).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2500
    t := t // 10.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2501
    self assert:(t printString = '26525285981219105863630848000').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2502
    self assert:(t \\ 10 == 0).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2503
    t := t // 10.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2504
    self assert:(t printString = '2652528598121910586363084800').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2505
    self assert:(t \\ 10 == 0).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2506
    t := t // 10.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2507
    self assert:(t printString = '265252859812191058636308480').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2508
    self assert:(t \\ 10 == 0).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2509
    t := t // 10.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2510
    self assert:(t printString = '26525285981219105863630848').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2511
    self assert:(t \\ 10 == 8).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2512
    t := t // 10.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2513
    self assert:(t printString = '2652528598121910586363084').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2514
    self assert:(t \\ 10 == 4).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2515
    t := t // 10.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2516
    self assert:(t printString = '265252859812191058636308').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2517
    self assert:(t \\ 10 == 8).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2518
    t := t // 10.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2519
    self assert:(t printString = '26525285981219105863630').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2520
    self assert:(t \\ 10 == 0).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2521
    t := t // 10.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2522
    self assert:(t printString = '2652528598121910586363').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2523
    self assert:(t \\ 10 == 3).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2524
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2525
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2526
    t := 30 factorial.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2527
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2528
    self assert:(t printString = '265252859812191058636308480000000').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2529
    self assert:(t \\ 1000 == 0).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2530
    t := t // 1000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2531
    self assert:(t printString = '265252859812191058636308480000').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2532
    self assert:(t \\ 1000 == 0).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2533
    t := t // 1000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2534
    self assert:(t printString = '265252859812191058636308480').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2535
    self assert:(t \\ 1000 == 480).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2536
    t := t // 1000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2537
    self assert:(t printString = '265252859812191058636308').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2538
    self assert:(t \\ 1000 == 308).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2539
    t := t // 1000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2540
    self assert:(t printString = '265252859812191058636').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2541
    self assert:(t \\ 1000 == 636).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2542
    t := t // 1000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2543
    self assert:(t printString = '265252859812191058').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2544
    self assert:(t \\ 1000 == 058).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2545
    t := t // 1000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2546
    self assert:(t printString = '265252859812191').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2547
    self assert:(t \\ 1000 == 191).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2548
    t := t // 1000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2549
    self assert:(t printString = '265252859812').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2550
    self assert:(t \\ 1000 == 812).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2551
    t := t // 1000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2552
    self assert:(t printString = '265252859').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2553
    self assert:(t \\ 1000 == 859).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2554
    t := t // 1000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2555
    self assert:(t printString = '265252').
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2556
    self assert:(t \\ 1000 == 252).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2557
    t := t // 1000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2558
    self assert:(t == 265).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2559
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2560
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2561
    t := 30 factorial.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2562
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2563
    "Large // SmallInt division"
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2564
    t := t // 30.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2565
    self assert:(t printString = 29 factorial printString).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2566
    t := t // 29.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2567
    self assert:(t printString = 28 factorial printString).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2568
    t := t // 28.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2569
    self assert:(t printString = 27 factorial printString).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2570
    t := t // 27.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2571
    self assert:(t printString = 26 factorial printString).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2572
    t := t // 26.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2573
    self assert:(t printString = 25 factorial printString).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2574
    t := t // 25.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2575
    self assert:(t printString = 24 factorial printString).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2576
    t := t // 24.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2577
    self assert:(t printString = 23 factorial printString).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2578
    t := t // 23.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2579
    self assert:(t printString = 22 factorial printString).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2580
    t := t // 22.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2581
    self assert:(t printString = 21 factorial printString).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2582
    t := t // 21.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2583
    self assert:(t printString = 20 factorial printString).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2584
    self assert:(t = 20 factorial).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2585
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2586
    t := 30 factorial.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2587
    t := t + 31 factorial.
1313
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2588
    t absDestructiveSubtract:31 factorial.
940
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2589
    self assert:(t compressed = 30 factorial).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2590
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2591
    "Large // Large division"
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2592
    self assert:((30 factorial // 29 factorial) == 30).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2593
    self assert:((30 factorial * 31 // 30 // 31) = (29 factorial)).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2594
    self assert:((10000 factorial // 9999 factorial) == 10000).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2595
    self assert:((10000 factorial // 9999 factorial) == (10000 factorial / 9999 factorial)).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2596
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2597
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2598
     self basicNew testLargeDivision
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2599
    "
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2600
26
eb5fdf34fb28 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 25
diff changeset
  2601
    "Modified: / 4.6.1999 / 23:54:57 / cg"
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2602
!
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2603
1305
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2604
testLargeDivision3
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2605
    |nr nrDiv divMod|
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2606
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2607
    nr := 7325642811050717153762789776988268826770436380599581066471363310499109217483708146717300025889347764783245287140288431825827761209734375227679364238973902481615726067110515609260483803343004535447652942957373994975597787908243354307547553217414840584715130217408586553614859382487727371958203670203728210853329589615550643569429545464633535838187607553120280274725090757329790353463095413523805494772650078306205912628165850732646863846576998277181504708528835125953362770982762908435490999280519117904719254192978414037497481935495547720579882482124362070304920033554421042496625143517677519951145301160506529078213700153962585026512916970185197699563558140876733107706727253226098498667726495707224022003616065672008153665539817928251568554484739745047105522527635187163056607022536498632737702947013365938133885169902714284727206577408496549992845715870018995222990562233528977494519678931256347544259771346247230580853991022721956676465120007969950427165372994323753297510475028095488055686092040724169139419916609256577729768013251303221252901814408489603855447556799027832316669978641359003225101118289255692054597992816505634077137939488367815415698567236171805308890522013024780344455911750571267472425322111576828023953254628842107966689828686941644594589250192289779894954314728890652959077550610325243691999405204222390497498029651468304746649735170207150423058209700682117896369093708787314191673370934168117103657952473409299633370355921652776795194998872621267955977007414487536764633556057244697184265399074262010357199308106519621332411646090881806679817777934087907609335095266207222734209276892672802559477129431290377781189460543831892579497032750130070072871363403749763492296712949034307352335981485523440716455874989554006840460427619480548908526831960007098095496673990791644237848915619019143304599320077794055989022733836402514795091748221758967378808917944360112901833917971660803687798356056419168537336005651674223355473407003283134339985506017270361538197141299934143152796116511007721239543588850520897247526805181747313555479146618959531019365744636489763407090552996809230736561767841333905734641055297321262233564674390961392651334871664325693448366323216336135114828870644061243807564587592658360508871312414270046251899865884799855978604603846784154676298841585915992392704588348304942478924343918975195923643629685241735276658813975572655538887395894943154837164154459809363283117923392993892589490540925513342593007784719441705148960453180301530851234688957032066907843949205120201720517233228017689397727501528654849506825446097709482577917667243321350295028575684178929416362809008034715382134959864428148337229371113753679702176851066723014671275176890295101957580814878664773530433540963808618303311433527685959104811072639265393597781952115276199443064654238529377585171747088279186943179071921057535680516445246724050154764542596741670850809674306935131178441317280401304117745258603320024189243969889899010725582438207015597258263941269730866138781215790257519260119642107850957073141852969214624609102867275022012968382626510150354544317157440551595548404866365232107076069108476859713524926579046999471537578555696823173917264727038317433492881860460533993043375675559974541501151536956388184229821825202783315175964857435121268159290087988520427001562311888903167219790907449246265211066597617404797684060743206718943066178740881680422221097537985644933108964245133276088549914210990590138516895520058065054329273143605806169872175805617483836108276041444751410352824841438522369961070941467306815885136393083146953817333717600651525643928410853518305074271285893483690402426110481100118592425979094825294009195497071244959721165805259378411459840402202432070097961411127831244002473025945590264209304535568932141934734427207643570840464365672020197014117057179828617184095466170277658012012082773008797284377020045199741711763429387654482036311118363550554573970722123056838391535176046275151704935927285776048526642046962416364731182508311665455959674818084140845113742927564214026026700188662967826830513695781752328070213377525743249206640596503567193612953686078368856837703275526312899731904806336662979992529567407592246922517958210869076841533625492899752157880746671555381617069359816751254049680535425407993431788796501484592904619815876395056294928500125620366251871965592128092071339931385778018271508366059428400618014316995088662886944531660310582304020782381824044296858444495836641436442114508798254022275527819884050205813610927392719427503886961325971042076759694523773397768263944949829047040250671591798699614674593280712438625552771672046770702177630021735604331681545328668356298896381196151818109965073540758004677376198693809341805742022883291609399453480948898873499293263877270932469009419431439504806048534024219695533951970768718607825512258459988039384671119861525055001257711440159711680468030006281596534069339905726514213495715578762483305792208439143804155140484955582807325734068361219604129672905439850247943374888325363536124220790929563183116800098259005080319976250005938202733026601423198594337116340040753176034747789519724367052821548790017492968600851467986834229393664397355394904449416596664697790294348115918027290369660030404309844866514596162383926922191583735197797285879017756435071691692579228371128194336880861331914026966533592778591975677047531809933445220376204094007852062763024256243247594908739310435742528343941136832141474614646195909007856979265090874937138653336279924669848945653923945059917473576073169113163591124139505027406426534299861184296286788678362064462571791247879481439224580152349380317895688368254981040713360197820623097965776497254219906627282182384583338997949322384688868753460332706063133692787241504223050921158385580293599957894628416295533076654622257184754535802725334290973325498566317654571663237347731966894722724226512101772153274798569796914026876025548743598732008731155930322538300118777605906397797200395073085079799720873331462360859558150294524673319774115422392855072805588331909034084940029643726834272412931634977220530411021804722158153773936709148601033954557711082063893472585895524019049770116104251942887519233166694790693305261370262098403931338638500460698273702483237833362913924748030573151235157079682103767162430861730648127306887340728587348584798432641373495081984444066017235036057867001084876034127575741046842705361078008658574057368371382290972551200828394402811129598512908406453163914133239324104176213439651911165723583312125404951908431958612444626832567425682382934966014402623844134480947328804898904457554990223633471152244935360846846872567395324752446056856314223580293777812792119222808747497257154119637357959526560095149732009525437166278985397825839476104252829701681188291604531178056187506204522297781410939426743458996516122417016297219533676135442588829970042448233678230743338567376323339403790517471808179478793371414460742848940080957249583920379222819120854583169254001656959488520268941651760355412230878512385792248057484840320339298745595785121144213305506256309005073307733101215537859103057428564045191401917751767528573372312728646224212563853090004301461656398621398256865950301741795030996394898498315685734194500204859005200129895914605961077480028024084166201706521017250564954091090761794215977943552136119569181253389728669786275631589077849217875992600354179303147875039054389958249338829071558805071696036014384280708136310202474257546110256018595074859205169417210438407668235772264489532840927011474245787805040250578989944089804487191960609374291147892392946334697862368311103975946562702804600592135283262705727886790284962999933595950396917187809872807890634995550768965917896649379618770995853018273642527941803602373748201162016424346818539699731541437191051272370389920430963850766457735997487836796190622801454117965803454310147963735891677695932780724907240409219933741153684518942237155171214800428187139788975348112515841498442346521529922874142809101317753813000222213844775530569928492214119218158311069973450417965826021228115913570997832587000507462134261658894622095296948660838891202843909918507703517052932194777950892934484326759830164241347516373904518928184219267625128730631587594616533889734599461176472989484051646992794549374972941033191680237511998366596928478133425687348377402191597183609913275115410415042943874922013282223036797766687562234708717228407526539793707192821641982045304637501898951672018353203243730498439561247010157326717850275842340724013349962837828262281859810432128342491502593655870623723538391476208736312646369716279126909024702322290468430221078966596856226868416199720051530940142548869537531144513871342122033366003412041325058744123643998708546094783795853752878277029993558821508050352135005532898315183427096073809860479404735696155895314871310840383963606002446025854182161994409438676534109631384937889800633421957669306238761422314292556501189945069931744515842623180008335951569700303152755271126472218857847432207385749882000533990024894030463892512867955227542394178393580753618051116929938385425024087970203342497063966957812547691207822897841681320712411054476647899997427503220523868363438443638138602058216412755412543898409102222405369299283907058054142505144252800800871766217740818073224044997682418836667094039746104705778772576150819423984585572854317991749574311863090200042587643440109185515699468359875803740167627895880258372380256331670270263041712499710565984020613035159213277572556237587993858247481402455200866484793496257416259856493587482957111225529071072537348695594958918648771418745755086539672404243468435455614922691041334875071267875391058155493338089472329161793182872605415502672937446879754623263952587889465083012515482974024506303700547794278667536739029569027539204865836091781842095979099980597464896983833312033418068148036099416870991217256675646972777065922275910262922486960982071022004929591359754288008776666205314556217272149643659129541170220989690332246883597290512968292817547469960138932109624850558843703432530540563548458251740803818389916128884564107380377927554030955090368431293751439829748472706494577940655099832463005901756121683476039133485795695397208495963616009088796806461291782584789937456739904233218852673930490171837518542422869715022557300014464253539379770130907001828679637745393742942924263739420939777245314275120477043103602195417941946982309000073013714022977049299652046646160515486071522858510125026538512532826758076756521229686019516236643861044256103454896600270127497654777352626796048814315579753595410684034930492848275912546385929478301905388366502770922904296261409762621660749049443869640676686234525730982815147070574292105084954509636183802284297900263494202277262106346273298509408501260925964163271527969153455344760075934784461266832139952514330249768607822250546116328645082232537397149287150870610226985594932674312703921712201689647303170983692623648013718537633610994267304884724686274443142818383020753736848287437672619884752757520891254092091290347766004298705684071656448745211379292411880056341949058778325139319915468910315101214860880624074088224739933628426458311629373094570056389962892015767941405606261884441947643048736689186423401799688135324726895945036118240150307617274590470074687290086181786558717205596918177872025497599170920256707122647400323893910027358803516743974239059498348001168404511372867956344817513606052060286270870628439157590311659998045156965274784647124177936899464082765921232150928558673393867832500877514025700053617920434533154013622992297424683989961395195164544773940494933482997619656975002955401823151470278628829447890583331692520608980058918604588771018141614644472760830547004909601105353723205204277054858100220843067696044358489288417053911779777636685862530733028148648527058888734952577662015452662713320998042221873897730242685299799949020919872610901220937556378878376264157771582659279927771096081291387570641227589263660184974304328800241026371644634693496152671628907116378044361348718616751343481441762999387959144794856149633766264287145359338550543502403574450566297906658227167549659449971682569731597042976899648193306364796761430963500027369518502867183892521528424714258941396654757315537208349927345921504783438385098575904450316533205383619867919490492230433428758373474687945215479480124116968494047912748080744896623860514834802919426785508712839994810630938135518361550388522230840646638453183986357427908650074058682630364404843361587964015212755669857078199544466122571728060539385378015602874360055774274800826080107259485947478571241263310480273433269041612018874608869206907030535684348688412466809171164973900200423516515617084359168072722684263238409355982984938645447365604915324694040110296398069636366148511098339986168750667254777835619946102408620138809371209811284079984973613416027249191446901665098739727142152623855284808133782852451728093569697499517366796585724689797742669468565268872539798878428345541861849015666331916000495956355163844447408071342491131776963020645656976892893787238149867119449591069976736262537015469780716243982143936721917630178728713247937607546958966361901328145570841011084562097642232937625937354868187273321107873039743053276603671355685099229683453605499731141681728718378187532065603510822624958972165532522593635204874376810200781275036766022437927240950798250024393364045682189134704845812286037422441193122739522406536732573140710828441743539780377865147861896193389749380659879327866275653179078947651387828111930396337490811270697985089816201218037506115014234142814682385102523425972998593072640770790725982414228544633029642995101682258901254287806742301366208828162477387463756687281252994501452908836547072102623355315709902776432554014376309587952657925497621653825666951796394661574770097931615332475671105408244630930525159146961999288995770715582728242072913256023911103584836889339253743344246510506913924657087924098478903888180830049760169862122162975453447015711932604661405562458098481070408233950340734255196874895090512289072552940802931818483030211719516961595929768810347559895680375914216324687844321700032530945151286243597286377866371612859700311552506351798213870409353454490411358344277477826150792145755992594822938766358675158288011584257616710623663101210097323109887979417370263612584058408561358753317231537698348461655660755380659581072178207477288688962757072265160490600631588197174512903146276684731753628694529596685824595885678007158393374747938101982904430961928841395951711676378080535123188351635638375470401478450523224920448602818895251564437834189202441655076943081483367064127416752887771318611109757781248425601474160571124303096368062074727513104959974456229598353065136721943994007941337054705132775534896527968122420469283611331960766006310601910252893459785872191278971330399395239110974562830357605556211522784691991561501390889806743958122904782088893727818201559345083867749044489168363772143703073453861134806218832960790409704879310579717552309996536217584965576262756407451564345833758720479629349944383529092132517915571954489963418248400511019703249483828204180370506184025113885649509409399769397711510007228728095574770224464446547044693015123777262159249799920884371538510122463960052058020131241942783200854033288826257878667417602086305216692912715536488620698053698022459949861565969545496357876743594887244566194824704556438285754633336308260058711894417742350590911910751979319176563052975803605412148165461044329096028626360061282229073291691883497842134279789428389371821455228942452798912977912958394511561774867405616536174458495043002980673610932445441383719655132197637184668163335110303541471123350976668674100112488910955928337286996714611124366551465792608110489076815010708899544256516556491056127346270833501757113609337499406611359404510795587423010608098938597650459332997781990621787924888569110021893517402845363268426339706716754389272990470513536737039987732318209821574773158004394368361313988432686443321166887644602545565041603076909330007914163941559127137026301018995229723135409029401064752864596947271438965582579277147631406637452843077049145457341837232159559730366551507472354953899625929803225701422561284852163965527957074334769617150236291205879362139935058355563169747778333904452955956839634568402701244925016745087651928608816736896469987882537309453244944834414373262938906464005059484038244572034326521612529650748538305485316521177247308396706868465169508059682590492304730955362364037150109353102703539473481458183308919847959243679572900240943426756852783203732123528501086255095826959561188972056318497725974188808836112899288753036602467405834455922655584156707363544433003151873583632491497489084045609299373141002646109273485527932587471790254082751973899027694147514158739383819684253034890946834373388441862051909883719721456276038041023850094627569248404828269211588662076341724107938139304211383814235573153888420922122069650074118928661037695827085823059008478593607756083868239999584244123010713329522790683394908267830112016051994957975600649644301974822906420255696156580630141761950629199586872747965112569565095469854869800403281833556388965700255873755860649520760282097467209698862605898434981759137733994266863639515406534007603175251563989668595260982955865634557781963224702857431711084062719151650997813779049906730415588122420262881103439896718580338498764211791089444646113690306378896098332737896635627635707772111276121536695313757806801348052118367819007399440960078665432399602377589467171594166195848994511848676342889852715337165791189020515662167204773204943614199127918332127383021743482576248998849902385077500814075914415851227356664528451616748460466665152976847232020446712913142880265960029344991220490001756182292717800761425879396636844902717038165543316666346164629380858250514747045491468395622679634227153126619733161441602334688751330958487543155598758421785605951110820924317190126071560389113736027517764010449768122991989484777981503183676348308768180078944633796744764632437921469707222455070766402087305156639658996955592139453843175790298794847443059643374415249421787873000204116964718653377159672324783600759484527475614449099007219842795509953657219555506013243218552996721200522560495144292673408433365706761513733674234568711615287301193667910837956568423438400639397963485968493623913712571443662496434067716848785221486690871940013498223030548187623888628374477709165936052912242994609169592340209437745724218818144600119064099826714575548308046604766436374108048400515726390133789845668096714784867008407173380319008417622029995593936143909536352013256938215644416531080180324802324618594097721172967615098799962908130441684305713015684547786299489529752824756501155428933939409296205517218276045889777478407568327206299474573691014209950666820875099905758278156965131476983278829571931391277816150330174477625273228440900552716318825768863185688529954386089451175385273662218329372749649446918354724443567025222349254449500617488028496361898409264103494905512190685896563250346346478211054441208028146386655248314336718654702652948137658435253312869829785373710193043688043958388972024841165561464326457180133203136125912400081649557668375744383899632969559862047404192319326563366004043695206668245499093118179837855729834168890145742251325448274416525637217013782454651636292195303239600214499858171679843470201696427000689391939448538191864553657744525021360343641380208086955930529022030426160885726040281673029309222840802065136346172382864319126701138148007706597835132695333947879760079153539055868548576156789850188497064536338026379929631234929007846807334812010645525172679991044333308985640292227558092752377643275995472992776698475790987837268792851399292228646489527461685929270374165049749069600603160046531920796900241727037869527459596145880819238533080519265651802795555015701064625591610129446123733504319175294781249602732333862539881844001174584054522255651608769617444327599828563581084600909669099440890092395641857086470399143117454131045827055159803551495132022116760892488889653153960587625841910867118206599437776258771080930144854653198726857646093716759295479410273617910942457821712732399190660866650490310710185557517394324308553105747144650750856879369349462377069251837917999202072251775088629659288184803660320127706626903128184146348671588370808814878328754655521943032817668859558325837576523141169778965733166386323397421920651468704737017814665502038341659575691927370030081718281672624943907725801459555157666049437494098603486817488433976626337340941222390329751486891908768166184463762670896534403352931457546379158595470562519774115429755212992688771218914551662191667783721153049023035595877690703411366361819400655202920269631805916454568041073107237253371890381490738743213309620059159993003849604331778047563116240972981607042015453452120068390822980655208034481099171665126640420489382675390866694573945421665672978524248517728079136569669375989021101850354217557422960696302555361297444201614660760149578194625887224649588332477042831119096972466903323569062428962777789251193844890660811230501531481978959612097815608680381821610023703044066176422964276045425566045824291045559057543333711029208777182180667218083104949199239136505834286628001776139959001219218905737418785641440851285017285337841944056173947452985842634788119839741235296336597559262487718554614436546822943903751831157623580674824591472930566041078221877158999849916636775398181102018674052880692512951698697513480517091515255566537032339412246743208266441707025164363377133880339650825219697569785046171337552332893545340847276858565496437706766030630722861762469516812573460899602135044490222233011994495526330459680983366359908902306295944044245771154099378936054217933392621460294966444315839619038214146393712002594553326031581417561314908364002486755770223569034363166238351234653984593425868697240971720773578144266846388819244504828181776390586079945560272760789021959416347716506857324409906002813134675432442066171228067068885528419141038131029179667706526774372963054478099683768936725773364000366960379562118197023510329482012107157344155875448591161595391919815262096502829728473187341874733253651529919979538531811286641534627778595530733985639584783830665988435302841891713116049103963675865435203124837066057645535281252657153315351003929269787455814660826997441903167459298690397042785489023802967671956590687562052329368827775864424049524191769265315949730487923955413049297486674195881931530552325062629106937559254886715285149290376041517510254575017089126238369735731441459908323625000391457129028083634733044760593008952189043595506011162821891237685214611886906091274976179324857590706091796406177625733347163004518021058299015360077008619141355691143129132531858006034134859471413635076801228545121952706746023220117837638086686354108957435599629954680243222435069621658931397374328297390779950081057015375721056239174253648058468325719338788133801151936515595963203703897529311280939274519350260938124229883720011888795447147955456430451126315978438040080489704091830058887795299872925112565712154018417162739997545058930991575800581788972727456060664226272478064852420923999507537882444320718854395590876566227281632171045068514052351501673709403201037188250295301734415546890351185372093093868842689894001551600934381797141922487365311721131325628216317486392434826534327444835813827040146040623702648032380447448136154616398503109030818895785037281436914811186726407883525589623745784053150256537820204779390766220428603926382471986845043607824571153400160052404381575056198801845131518390346351149303614811547311242885120974347678264504367422058114110590584616857433600543740991959073794058140903494097716255074997440636144720728479858818431649567101409884610735460498756656979805396736031128522080195025672224591817816046577402276820084711291274356314869576152330615815241767096386124487945441087050607753895420887678873857176400381643559607194474756870418606846938092225072149441622787084691405251105866384641135662322242739576886322176214547207279725762284255464168735963793003697380346821240816624664408301727144025359059144838660419650159844461274414337264603692360330829781038559372304769177150910295526218586671075425593440499090198871740910802116275754099660717081809348908577040588631693074984232662360693119209505027983812508319223671439887199802525968038619436452231817179841365769913890926114871474823986102558248984056751171047487920908703881344710413315117402556245735859539904885030456237268421343054705364347991234047913856137332488820079750762203668981258672591585746354112878783999551179429905553595428779319618205955760109855092613527644960822047320473227114766963811143741244543560984456111125291941526870369848525824391192559998244670495612381361646167116316134254469202262396491358927397506005317375010817174654504297216767011458286649844846972401675100964256583057423372220731293103426957596949490693959409243387593122271779730186895385509002372128203913747196497707222954185403205774019431819289117303305570247189365499173945821877882947041265338660691701329332190962248344273179360681417405107489124186407998243259234573342968597256163713209217434289027957190422218111924387788256131382512827800678950844810180746534889923898689642780000177422130718538953322034407815417934026037724751662822483375107800778896663583289121202278023801612863043235964927529347161048346388661293376210119688831516982901549177542348947159080101505257893914409911057786247888178114455119581370181777267188461192806263311755813332788407091502471672700680467132633477533561142293966656214747737409578555062844314602141692485230285966094671781847301987395271366469630767558062112328885393287218169191308218491026790992185940472657740498984495459678622709378403150335318468905992328881663104160804687882440812818881405288046436227297457076591968843740953385063083343962623712923639380484489819982491016361780280276169822287192392447562183004485125881771767301867399126196483636819125433619352232936820141550863954332722336201898117119322617189636537779715466381486919126946687930671216141452922541147106709679828617423994874259063229649123229518230937878691439874612244954074507844778683128526476317639118125371158467622560854714456375919537991303413072742967677940130456040692658489636525122293276481109808057346731810379189856938253679165389325994448637996699383494712921721075102752165363287472411045626443402092824653856031130579486630852299223562415803848929872524176136572203720259791428116844323532933588350929434768591652396279151377056649946904423876773164294300631366488764834105010682185485963623493414811764796197305673062714223556389869461430429375897012606458055194019727119699064615147436243860806192462008343479759672764808835547065006227356966938579183385683242312914357531439848379226427244818697458161912778146111681862542149788668492334979217146007920768310239137555938899242435302928517891968231720891496735372779516584037533540785957755005709202109126682981133492715169216867882096335742028123146922474139806442352071726795065748233286421357136259478075789617951692483512515306524891863357257717679489398290018317806682896210611402661100160374226086537049073243154990027642836396613193310176604504810534893772428808909650946232081171095067517581083996381726077971297100787766219854892974450821766776476654920958360090137474327967048906416972057811898669752411033820021430818244474866948828089694542481365682716635711181667411943506580099933345985254871356053492593961261410022611611638590502797062851727396497071058602567774355094747163736356397095850006997424923531112267182732864620909866113824820058603582958531094555020510236027027614431361800988521200399586673119547081726414690946264630190526634425644735734369461310520499007520355499508585543263341743900683573459238052117903500693000834091101712801538465402378378788144062565678935408582810427199506747176661448934111477635429452999529543080018774599929511274133290665853831807027349385053891990116923477073601573652090791807519295421039777391917621497541985415302633144183175238454215017098774097235275853537209261772618306543730724023082803885507581143607139751832537169456162439207812666381128402696526892293998914258723768720017499847984266585234913600117422675602853831759174426206891377825107340342701248119230213445536811698998359038183296563935302499327006034285845728896557943782923399556727004316890263067394203880281380073469638121484580199160819715617289728021829847401418693279991820133854136572587461373226302598594529298221390370775366987990983177009324833219732528831629990421797299223802093648161616663879975810476101783579393868468502081257564874766384664501509001183842063196032638224612125668482059082665228528142159069942060893915606313181707310505441794055294071663547920016602694400545595432136470930681411209271045562029874387463078108850054385998584637189771275294132908369193659781957985776433491190297689914665426509472196522411323928378195300561602310224530015347222547875758340039768542111436297653638278662369121460476330673013642837634923317515965253459144537815213719135592442299298816576373126634138038960909820457612677675783457258671339723120179633081955516804990831567693301696939699672015449317249971642551286584808129342788832029436801657018628358004798080608105909323093198784846845645325386979597398678978830345672780153323968476179576140696425471821998947380199201341358406139850774495886929512793237490160142870088261156365616557904316857668388922739833923102142619761438181312790544717406255524534509231320343527106989160031768626195806563471881286599066109601085681638916394858229430951462409147214901977476398310691648884105776491098520166157330063939443875435796943355719969632950102186397143687779839736579836206933338819143959159363406579332971362010077679786530037433544098847138689261158878246792507024969634114253622560056328316234987527324602651240456647339013865004249242977561395674701577956969389900249185989776680415380350732334128309923836114711035017617747769595002949511282687656602753426366555822017768660677216237740216507472925748667967000999718713527274444690963987157522627787202354721060271353729547313866987732075979117079846732413636459165812839433882317207155027374226318776368857252794717448645253705770992655896057862954179644123532323636460584760744250739359102987786758637467637353356965608822802371506831339109050545031443083639828791912591491173211826408402061094497140550687518456511418634831704222491420398551252188798829570316127890035938622709348295255719221696461602749283552993638948947540135681555161478489620846449605430044941872799703773058974361817501697061476133321363775760636069455030846228779531268123378895993835780337827038608856140980413745864293745914406340229750270769504339465352030356216744024238713735806990797168008854280945697224613839870090197940155282712750709172194380153634146926816676024515823584088231400463312382777203125668639972061892098691453960817235720605917593037228214044515858127191970494660211930516466145592663099310492447409876759547267269546121606395117066909754582947520241309163725053673240679714256180891234020254453276258233353933830411269188099460453101101892000756745988828048282222284444127415763956898935615592190117456834504468742950360516492684416298793335152967766928852074366733814540857573444455528985644845185065034346112640402659226060116640258934520978930605038249624160204759818066247093333611839083145229529279417098896841881437979538519201155777645178826287972935358996390354906995489934248530800713546948968183148003843919015314165041496161557496179086007896577579617867935268933548581362341854451994408726034928832137826659990639338937799609636453283954242809205539456878416214070953644356943389856818432600837207778616720748676938374167354667834832060534863893167858537784770073045535612859851873945303743454718296695298634664951824381963669712257445362562336753508214174025503527830539500054913297955051787866102185934642635331258792400637526092515185350299170488147855128705105659867618088688753087658254737196930525115823965358676681318054168230606026317957031887517498191886041759009170380803971677533808855847935963302413449922868960528689064335811771892647412655405511386556297232825727620645847030173878179578724353115411237535609238689560816107970307741703445451087116907161445232553198068240181847253666995114428407076706548882661985472194213910892387669936605281007133618963508657753133705642673696817486635123227343786590893113124229529397388254617250179612431485026422687552078010821860291619515171241168065674667610207596394151847581338526738718950716228321620075816773740443990198310650129401028199155101511828634637136915354619277160368249371381078808111483113736277999666680765128118757290998894150630894070077301710464719965589744182899605947453537434325424659568476976257807998688140297038415134478560327804024687366732279706746035700937983217159762314919697722630018306620851175305234116716106843307138903094060632759586446063354844094943376435539651295604866223836562905109269402588222614796293798277799468218379916416521276024309764723016595827980045529911394304000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2608
    nrDiv := nr // 1099511627776.
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2609
    self assert:(nrDiv = 6662633323731567683137463770425046119972136130490599558899123904210782000048955657546048338089665562423074595372134746708823296293971339062117626089251555169190147414256458077270948527569093617282899634080762548342679827245086339014549187793286219479991932728270136570804297100483133701307636938694238970905034502371154888869049996596580545736458232161676533246213776471749761506965201454953608385742563840091139275162427885091025804146353946887012629948484423153743921621737866106228003445067333011961381320536910074258682909144677567128910488902078543169686709037300189304457148994986416728307763424855244492462783182558234861995982025264479668930619989751791520673311176554512802339256928913261821455310942897696812136624011889515033152342298071512274969356920005509130584511715402639886394993433908317400104247253605275804809213311644722625708569208536590845345008858415466399942051501903967025595429523806385287189963483817993580193128873368523227715891492147715101325512000610702205499988933334611073532341758081435343892524554804643431682872519021193151143459141893825137519042963177852473768417547297991124700818539000925406141630391619735578765993129524005603624473698812857747129288247152154569878280492149839872603436792477479782943819217222827905602197688669811923223236876518868169077065932115442814112611272507112872060586623457737282248353708537440207167545131324624997338441147538821782465377847014831893014759727951431431968895008978190868943052008828655078064891320004323949219391175626919627742850388198587106996637256185312818463363915808151256605758842792136336001326613101088899142459264924284800653801657455269721850699589180141531487149252598219454805868157021677473942233257684196639595334983355790828424192909541992782433644995416653317905481191664882406344528748368967757631115924249587936451097739407299792209435266919538221186568760660301420447293747151306991237865002378076318280180526977727975952198908682179738530497531431395267954927026964715297743348074891340859860789456898608224255025187495012594124570391779113664193099927268994661989714354273464562908966902793335276088839025616229178681024727936638794047725854753445121469971920000103358186939952444241621483187255438734831666410707469056761064049453502111688296190428340923841441148946475354163955033838270461267159320949165980839533335114464512294874697208511171752685785408153217445523193778985790372496161721264624578255386880658073907934058789510812259862184677985571129419404726995982428753663670210728075205992308115237575948883416665937774630699551861339250087280966997886464539913201627606531742484162972849780468425532497380768638445224373234076062753384679812079141062759905910765766089004401051262864330797018433052954090763672692099410879958238807338698107808012778508416688011598376942350173207376910229491087872782626788596807338691230630211536158864622893956734099080442020613927228902807774992144293064849356703912470587347365098361451500658414011543243947940570486265588687939149293725873385717495020907919850152172396648759758331493330026994294732515271227954608685062834699381201564024694020978463624585016140470976879181330265581934326720818333847725464851389246839097102050339237267017355400679094305414741521873249018386912379564657226367474609265595843167030823823815888307326919859008114043629727548060061462134640542960003237935595902000153006810199318514370026314665866355006060662101944184764882516982242954519270451909066555817897156024927674610449508845588002992024015689920157493765829176802821931631590241487238873985285696003426340287794076918847820343809440277189797464887583441187676629382340618054613952244943532083179065762391482344807692465983310435881557512776871445023245934926397204809407259057481926925852885928369964436177662848362828687829863675543005561550690069465524227034464836091588464269332378546107140912689644468971000647070233491616299386491375149772573753171449947304356213004974407827081491882519644546780260294370715784722926779399796198511750540506872925851061282487638657519313905164405423591836522816111495281603995252289872385086476469229310711401528527506301257816056801709876959217865896545758738590541706792036682061363760042257088762989112039152701520742768623568505674079807810875863485081257794882308576605276750150366298371039105968353284329219873078273054143543278652910514327315532991571113396292522800982678225773832322663106505081384006672724636320985174081562785472030426212309827534624166323291136226564299729779926610904852724095137745669038747074706380810381924397482883612399986254740569208516035970744086352728731611278556045932012031400560563908745853060950689115708469515692155527082269323865892247308760070844077451853262294943617058144830374014063090229211365020886204814145346309426230627122487421279225644442725951826590928222475412083281764588227804815128066475027958454121524220172577508201782648035333837955540129683619410765000534937610139700875341476734142047589998542737528010306112593043148198988006188165170845763794500602249285494318364329213288147091824616909725569939842842543596840734083524325194154098463289461537667911688662904500980902221288027220544655818218265475837746996472010236584007176738575972462375026150791464142148497925800115687265675808142920616038812782060447067014154305466101224458342793123964105995474584535180862955288460196781648553085262219550209211207588026816531112456709030305544360916191463216584932837523535301571859795009182479596217471466926212940178314362383320867455900637582040017075517949772956047275866807594416084072169300543338235271482325223007196166301392848144570452154384977210957293114632528390739972304218279369363788615170503593817472053417243282259131772615839858816679000902088506393860091327261674653574046859271748229366456048072374228952936986954461812960776844852566037819383835600381330161020048169786575176406335437161125603009418044684750306284400745015540086325935345626867567751378481969009868769532841174689642757402653727086965191901579737800170435839185407005418578658287140871751975359929956215389060409882342023572364751463302859267203670036848697371716329102635164492370580294469523800234173695676967556158058431931901118142098589725146905128352892769397385982936860912089503320533289229159009276510219167066390676852427014511459354368805077084042375052908754180535991959079169140810351777905505393392636393431646479931302422033114524318678899414743110703321665415570194813338103931163016485158053150293320176682849865950119830732697413244124732414049420578484034599229592065444814927955090765319822680007274309290373729622349451338071624805845426576853103003370567780916419402325897239482929120438541569564424943334867982370378410776501847576669342499380514197733899878037687667052618283223365943911896105902249524831410057706578101179674765029139049616899153094252341846800968999185743059608692632244338477301941908375137612702490034105885096135690595893486578406810583373575282511613130846721636016131016419385094668786170270105099382118058667752659173909237179323408143996490057471550438372565855669568075707259687274506958695435449557449093301254608165917100788931501161845710670470989502338362996305132945287246866702609436316376008925088459078082627911685321128243349354229036144786259708802466926683070160849866228958572801968143008687496651087821709717221337749533437341262096267973190948389492727237032475272862079136719557335553937772424498412907282167253204658036522663912861489967343545754246593032273458846618876337536007203682712249257269146062576546910876450005243718339617735736623482032784880126505138707551223982569305519703270511483547382579404918839636852647345161672956598447115365954967174398002999413589275624553356118459301663295512883021676137652660825734676124215499674882903247218052630206577642084012432827740455157014364420171474367291740649414319526344397807373512379561085192818359161938505367228336721095291925155065811136228538259401638220286361061736441517811291787368531134060596121120227508274377982866581596616462970013543016021749257061326685130571812001938788851323431118096288750404400065801469551796490885764071976072881177700325727466583683008951024461863889728341965881114787320729126972054716702704109258400053128328990837507682205316986695881175358221798319366772405548254243978588753267948484911744969711778505544859566371008691126381031647673694280468482450520966964802539436922158737077121750002067704209950517947895275485187950536800011107737855580525830416272726621826086807998163498280837268646635732040394769166712960660791026071702275406585969427586620725056827465122411839751932641129741050664123546627575912560511096417077652349819389991841973046133599693459503547277028739085889123201599430748088793537859468190507211174911898362104739455512577053830969074103537490200197207200049611998015566197237458603889177541028426143550097544365997852341124263498329937465890381606795295955418098232523840580315613869908469965450988802338848428525762122401606821882953426082028665593848700047602082113394220896647213988097023709581111850996949900598384480808761859793798146684096848272987669550104826786271426406384927141254967004421494402774831090228439159876359957377770662840899979305879736692449207314353197306703720694762653242964236415719707807709474598662585817690053244256584634094675588772387320728876893030232700378159568564796767815881221577040003142829035992250009683957501514432958745506657813505062455380239289536840908567419834056655066010679741591568523506419291023346414842722152449355047334627139443779463897483726315136235890415753009343093216483474653995240946721005159273994166538118965875301947867114969329009355586236318538876250685609005070430253377255824432219814984476455677020466705546834887611998078233503929866669094433324734408933206886290341422947478206056966064334662828420717990695296446636482902339973289591596091373182364602203890422888673967906434865718458245218781812358691248643177646331019984492877159627032179896760671627209600850253346391553616574626603287596419349597318213312704240279836597936499176049259238779919659359224267409788742546907956321200282485507559458481839743848993694568980420138364844893768971338467175415458491804391538574796876754405099255829357011671106608209724284478263756619062561946992484466017881479781226530089273673529323906138417286165020182482970033492405254420136568337797393833604513114189281093733322434044566828573546466011111351374026204357974607838989739784779000309310988838440677460786200468664461583688408649555734386828226224795341890764896222022843007212559090108162021383514450324833808323442944564068880379969871474643609232099524672432072065066171371327688290179617734777653046940553660629197979241904416814835983950855274272068765736863745858963201045536085042989062938403688763487261963686964428476887533136063512074332363974690948558717214002383604926898703662000671308292653459533824119645680367911743181294681283019279375110761642291430932623265766493454469257647709146798421760001872528500721048437772780065726775583559870942098046438397119753740490868306016527691410327914835147693629474332656459501972550133927210561728079422781253432105249315186092695867012382237378862014890057147969807959315163943016544546298690088701484361031394763122216597928194997139212034462694811542459062553095389537586038839071235015814370056111693269389352305878495387099950893625189881278100442169827936555834473905275492197948797975758169884639129722925686252861191664712463696502617916924251331904225415709036855212464161811580220910449150251619842632875245719603685469328376161861492205183767960018924893683703862737234341532850039837857211248675033249758162682137534755933837705941315666354487585368176046276495167470532765222994435005694159229340308269782771538682076344939357692679425354738694430715010693246526855161993822050738084109068988456669010456828514452172338697819097988850645322196559280542955237043845644875480294191294243671628138352015652035502147832020273418517146314693212385602848033983824623687143092609964470596861648812591181885313558137704270635608088146327043933109509820109861326543893172335781445926340867738481148623616697386431217916074089554450405103150269058917608330277763824073839949907229906564057762087349990311778587768856946330357372471841275187565424737767435082996992995284357197931917849454730570975669701554500305138158088651708126085216389971524685018121085532248742434165580153047378399460873550609161599238566767462611149933427772707403493393907424627064456087353573406713733285621911399526086839253252364920421564239246508902633182467505840796787479557927720879016862471757675729538193109452262750608872435631538942265160767804915408866767719853735545879556628651112971951932782255758506758251945975744362293034679502078243875384929350503323125647362412515669719705455290178369806457412764733465715860119591022250156219106181326562931513112569640527774437694546186046408836197585138256444950223039512425447239856838567382824787147773363964308297000112321579912390413854219643773041550014586978847525545364794414262966819887507035652321303620752105217176216667343339142387440168685055366893363995549376670079553282967791356972668015843949376745456315682701891383756331415264006206237965084878941733844343257714837038003432752137257495692759685719124680847167412614538657367006068680166919216423380951198784933649947788603088487475981482143383660343066401239813051800174000533422015517445025423914324655725411380579191151076329105654312915546930776739081083130851209560307261559808003595454190858699636192994182698489579919753682299765480387055479694566268008903344458287769365183187828409240957337041346594822068020495286153916970285888477298328581357959138997929436797741893882044055962890321491207955092531472430580766283693859646215925564679002104430854098259562738959271344578729377212911592288946202639427352171631575468303031833703338256634096377869121483169247318904967557580606897753481360433243071165788807886349764388293820695191793366944295901792867034972217834675333738411495592200037471295720880155324101436263128307034059249353748610108195767389020979150086248268345752906071488861276742315827848748423651031498876866413731293699920942666225974254628767337160594389199237190034723264888058437168327407572709723914804838989858772126647736411522980570465381410084236050678330973124991667963023842876969302469279748200467545110485810034399278411447631362160061302813940661759884034612358568237683981191908865801458121853442888039446172937851735631594598045659655670606785063854069117622544099869154206792904842994724111936422163524033921205447454737571280459967114554653337916325943852925554693909749040789538931789414251732580009709193386661331220447753688008685205153591603394795178887882480498680277349305852539404087412513732493890167379734424193689730774421124197396598209807938986005281190551806069183559876875280125104661004987176879496554550976559950467476559304258484634527452519381498017040813588033614753804422807393056528398772163482132360711680090004176924055583698960466571152646455948292335532725821865747613587236595247530568040947130838943692837511089697894954146145800686471738817451943314160624802839788362893581912928352442591061642144413099049343949783668458733212864946888676178097687428090333954322728693913329532371868758870453268823927363537857721619750427589553115439726294751268818431424046653951176908373270894803348106787107152478615187412606784084264974789511303754855340051658833679689870263545431979424720394747263593027757345678621399456268980783872231272861374648345111361698362447451983621128788960537508008651496314069548689924381907425158401685801106563911310636385954732278263100830980578484843580473312548144610442900203565265247985546564550976724435723289297624666247935684674418868117603325806261281593378413719037238943924955877274085741135966282362763193106721357060382514254442887152906589877023423856680625901166776450727839358966536601644959153609144391132902459862060242188807417448009183469264503039581145496052228654052676496725272553819319933882997243226530495493561285061107687030878215808993975387490670647281729045828867173573105303000586136076645167624071720961141090470782549551314716665078642257836261666920413308268644174214574267682237346033030519874726249630752547960543633630157639983049125491329584885469201996544958519723770711888804039467535780543824274815473477301096898595071283422404678758221733495070552923171978588751150443266365227380501603502573111410088460947042358483807313590240913510077173949793948813061142184688143009613447113936857687916497981028674162941533323818450350080181784482364317988060883443497947703206051150533242121659128958857349455686882605353850969092935960402982618118713619556828483369397811281916611054914712416483805731465976494964146531569215799109721805847028410300528694173153527532373153045249500878187581518800314615156447564073770740022098961439234138937750297512946800381652855912829289926467970595537813845166063837126428330597144158673094574735851632185151893903271146216711815228383779829505875249782822697691614321461835203609216607002918525904157716238810383010391065426897393809125134642778347338844701765770751671444268397042348815101706901167231064172608725124761680162478484393439069367788364606593491099359158275214720362749380640577721088524470104995681138292437981278208476931579225731985482925571630931097842007340469617197091896460102706347332362145513466773659918337317572988046499916670479070806370253529002190952670353070666744678967350036570834703676333309881112517065360307108417452733002563964433340667896821473681133465222881870547446871335962511010619755236243761374511519456442193793333594411207392794004105476372366726747732579235992618924015878318955393497608385365476617805871466249190595260047214394069820212568325902033965922654033888417912286484711896882467251228378354183552293400075258206316865187130275079433360393164503976387026629881917025668725831325016331687957472029777811248536434487962818526601321326034011639998240520767133091723253262191478889477732161417549504821178703052409631566820999340775276726216946712534308446072712286153652680439930352040093862145659622442078648977666579419037446128195327816883541805521638906205222812059694261274802822911995857217067861269000490423940129053596411898677534589257055289125128765042939890889550610075923551852304168673133714809214526655242363576702244447943074362796222547671711899207308354482159297375955786574385854460819445028523296167863099823730022352090642566296479684850099511564373087943558717295760938927621289992360634932091140965012523878555060864106373640658546915478306374170806816257322333143836404972687537427918835335849909537778979043364004415979697596187929554163161291338782947874465678267621156819384376292481035494619822724135714643080670449194349117313575477023852251462157100442647234811207590910430078679631359082941846933243892425583167722406828385000563844537531315125606281753470690926728570451420660194661881586853830856879082022622614444211189862027995955847075720472590981636180405264920542673876523908199231895835194289372937814963109185400558429783080140339774478333285537556699238361330987736558384436762855693888604544252644467982372255364280010369297262804435889271193485633563494271128632242998571978869071398448928214066950611845110439059878457358040260838872377738188879643075650321115830111195188171223607598166789592316367410292281897474240707780500277373863291840300035279288645802844513739755083609307623251094215604446493961519719176201768010830924261149752008240975627953538656464432802892397239873841558197762448235088987744283265644123580215828629229847756497333042088017137113845417927907308370118694686418872787249521013870679592265695912127418059324065039553961809510883312277292682811136302844531110387585647794846826942508306109847156295035588893190647972929310585300837929143605036855209909095078529616878524697187949533912616220353861101335179781717322334159325535950830348702683903956713848030991031789277686038206518291309335679266186892665696297646824642372383904924530689265908078515046434592113144186677137514316332139654331264735125017720528644967462490620083319716124344933995590200417291717086036610960506908963278468132327493231742534480298990695134370300218432020485190379781750952733353355873678374453180937874211107688414514621736824496909620169986303101752871651896892513684703338313893053933255183789081818233099194429728174343667583800232334087537030361427268946243458842786771044962553296095536703477989698602508257697525945310759504846774891475733740196021161653485418777347759620656145992080798847727381685645525539961559324870188895773727580412516237803781935982581716437412611301343261776643304819481868619659753341516913182720637517474858444413157832505693243741288479267641371737999729095261543591838054428973561736725472157668326318183044945915784847874576066830414147706853941955038585159805208300597749734377901157203392876608064388184267818682399190422948501056958194837938391733278658784527755984424606731034448309440295924193353554895405585796132948214826002362174122627776551327343879146573828709566085927128207558802117131623323460157076665769242068403665185141160275937828400136620241192456176652835846834240452613661806597521514177023165047302341679295555551508051653415609814912335474376911818568116936865517199968267319797266790612855146314008776741341483924545019506352746861761799184869747515293258290656922190388865397288264923207565564444569202307046632552992848187855320763025731448044322626818272002953585947000990139604564002024944509293877714454845365556042038716302410519861492901060742979671634076805703004367909180382050303746373376482562884571531258606847571505895674729168873404018309675988438701948374926299395721307787395239134493403106002139242002160785480851729136172763278326205183918096527325878045633695581592505417560999763617198587755156744222535295963451807660480724900277337461447992209534969141734072233109797259073570248716353319773293544532922325041060565932210392148625152030199085590108347217176792108238881854901342897723225511945547225075822119388548782819368313852606548106078809355851189880251783054363594122321357531048537249744113050418065369091565603073630514273403592269082568082618298317632108493592673811785028807085323208525403120854794483676644319669608513326174279234197287824669726834966393161538408455310478065279133231953852910635361742906178576755214111517056327801824696461817882594873856805222646175203300964795337063208197930123387100035611442898962537621189321957513145288545491320961201783084023485230318684859529665194381535043030992718697406456699814963178889130392858728202451771804840042186083208062615168997950766084371341242335363877881080966617516431705681821487035566981405152551846308469495319182057575043059043266754766612593919342214655158708509550193047862153144017813642739949190337390404536833912770771422453449645873712360457151269709782651006515869206669914944100670221090425818628601774379853413256806505273043406959924949474450066150399316439803729716402849663145119931714415440906395699971756190018053547116471909246270169142909777111146276158913184245342769165725317045526866422285400296863663896924113569981788011574855928342975415991851606735244243464910312696061102300896479291942510255551582184891858463744530673406535967971578872825659092205865479824130931221984452835683846238511093397524783198334851506279344401387929443807027481880885621453705681630631089489476296770158650928120354413431647606394294397787931502924588063599432632004248814905232532874069922767722869190218991066223241787471443921552795301565594166172669223986011515539182639311651756170781133603153285133649653252244928860946768958545104628751685086750644332576921314119710268248219481287934045631571968130610735349124325810882583205080365791756610466151484981561971003167210505449761394244116973473697036540303439437127913553092230911492056676149949338521015670614036534613837352259788911948678049240902575683723282770265260665156443670989248071839321931056089748674072520359193076479425403027075088844834493105461097317694330573999345150061096450395197333950671837028176159805717611029046806473790966566257139710214116625838120990838702278978040950346826860768941596869691912534837789531369798770098970462048699643710814263334282244825464986836886245787380161175413667682434097411896621020758210415293844773093205586852281989095832718586711802332595251072220032029846195189676026260605198977294380817877532759426557768078860163274145878332404258531245748591785784732434092195479770525481182815991797959825445637531042041590611915627213811517825520630848877424983543969674297016002608547715519350568204779042177473285067882211063589224482812938087537556266733962298371253557488669907498202166954216996752726405369916819110824141254269240923809780103852072731728780585669680264810684354097106594938306148015694140288412584934322450220045927342286585818050261340652821302794356397253238260769202499770588659806660140473202066417966673912609639439160027102210101993702837140062159911232700217576203854458672769125159295245759720586896200403026721146586614053545788918421075536183109733062570888899435174093277080789621706770150853469920781327693942173755821341587589068464271704145993398599584907221853546360342946465638677014265280400684536972824228071999739587025848471588041430734190747718105615643467867746521139598415490025819320522905508995637789651392767316376511141387782210136045154208122686266311800762358065599182356318289546167933132158219689983303226956912482902682742562956882890951086189973976745290171180581408168481701573057620693909613412402204890864681757904552161551141827082091941308643128752309062650317371816701150436066224566268088838544515729608051056365801398632700878033879524508762180929699446191226165581504065642383358322411410368865560901282689855037225200599153216302477288730118415860928953243258084527371265976649892602187894583446506824661341966822666806639851892328985271557775491086085232594029385055865408461916306201785026239230612752353078156174629354046816769484345684696264666983054596622557352665971692310835346574330345201496241524653879367068558567438787799759733850664614404312057082568243566243264611755532824513206338793606426398858650893765086655494206257608941685693604563423189826136067320528442662007709432015815995036214543984892269361804846433637715492042002645350444584698809568222374258222855882789968774096068488352877738383142437491050195487809265738698926470769757932536635347362729215411426989493149132973739280148089755991263176726327550836049914656986188523756036995278451253055657993910940418752312028175505678115214204318754518113471033399453567830296130632358712878292350291176995772240851095811885600382819425746733946859746508324478039308526824527611422610279849667882833495985958014136406544044904587156035768010650365190466997906703837332597903821402668562989161094199987830477977441561503597197569903604778604440785745969156513821971317777734960593729892222534437766021930681857290367110308403828050424387397529924995329948939921686795128871033695479567097677596871009758030829941780656916571404797474936364060896633110223920424892718562704497565532610704069917480058569081099089548670722155086358551588683391157320485122061215935067590527729478682246827509303529818583205679553217829813233875900878129084480249700435621359221893555421656631016079536513126020731283339909012365473738538062828153338806425078848354593519707062428992917258579885576722482493469235679741940285114466917413417283111876766818175178154974443863226366736031059196645787709286298438367096300335933725467680069467499909440931418935197607639590412522403641379231449900907670483429271445608187324020277292393554157047806016393560149763762182381033522232890923572325247499885048067389323525383500510263730424495499130718179426732948176129997648391216839998908481381658481720639121202961279302722168225045179081535042109498981072896761625693992602288769693937005187754145411851890095543833095500128837825669543033101870261359674246173474451228851808299126983017321230451884981315322155989426954244248673352579392307130099271620208255400787072330291414290702789609332401962725750210933255324797504516682254234045089348533324403979456676711927551725019997708120073528175550873441080737501788656523364635812866580670909840195177187069318284588267347979941912802844784345831364593611297335034936808260937486987558839356538174069247197363090244587530678334043312764406429614731545495099078344877149268175885053368093750005550979938553594526646815969088249884254428243750041746556055016888568949674554438216069776702697157696519299935296262333182662282071313712716657449342194593759461100188202234751465974594013604537342017369078900004007398193157716190449076813514282475822804094059889026022698518255021018566613789118518865859608084164256119389391264701034534732838558655538866932858543792259691591598582535802657208941556924876214292388229473818284170474930333525978514942722320793145416739308926751303841482388060395770004407198042502238999916987737347202218320069564664408185847098410976119863674399888748702288385011759248916565214546843591360560021875820058954120036097112067812578695283900444351683579270658485758109768365219991018268073673245141452415153257605271035668837906171755807778795902163789814583104706779368230557138443440606785024625551792656071322197883437365090995952783614348640636205281691939705970217021667929894789600090514708714961369322666305228197508897774024661140458911672537766440222671471229951151624033617881679464177246524344329265010491386519425837542838886652005593924469815109793867033638413339131777000951938840890851243026333877482047177068521520544305276389089112946918609981082936282961399989478134865584383041240801873372522978899733132202333335987926642791396387737460062342731173436754915777886939051823043272012214390567646298815125607368226168423465650669620628282859526350836831070319248452496846476074443081172225109466966238064479543952636729745422601763049244880363951554887868547504711176462185190973960030994451631839790904451546992926093730097537412791241442962734438292246577722247574954339022031246782698069255135790093514932928713132636296283824008266832812586268454522044334878454397088449487448684427415958411238210941094006226613223371481809171527041133037308679802333566255552440291287322458475809170568522887554612352531686985995739790461654054890515084932431410095449297397334371300261611842343335002853735931084493419009859313463150746745937117993181979237854420065153129725284950418550289719097671413347458337380367124698634870313774680629978154230863821318174197007261464601533093656004192580013539666996526642684130218028293355797487475150542981549502578133197157285640759714023684275189549422742879177088739931596862486920921838596493421040431594601794077020970428521385813104989350571619913186328653424264834109846015474715734651184107559529340562123342071075931760092972222917153919505120979479996210276995493277547148424188113124421851635354366780917880121039406318342668232723614810087913563184193944074400000020651241097090115446220825337562270086194397603167464030037171560664411210284016084866369808922429203707401145416737524009418498819459380189832249442354578023256629134645025981931351423342611135080339166792819794476094517020997632103158198364641168737218921911389876768461303546227036899870881483511952646784326359096061070739854717639472509669848383820755259857413438295366884308513205076426798185817815788056573628577324171420253648601799962441876999872888804170580893843687132338423914822285568896284471765223814674175029590016487790058849831286477480407475595110497851792057602582603288109754011617841039164041788939682140507881575497413757336997711464163036851800068102118379858493913037721693270703130811009983095221159466631384296982518861383773854535925194635985429767708644654123929591836266094263942708064706075219923980783237358798820516481950692318906711800446498751709909979900020671710215406281991004707258633142090505396170787878142555678201300875442645229957683266757709158189715737432850344877702847733425342431295550047738114568208344247343496544929502270432466561338343828440563277268125158467734124526783241545350253573063926687226489187301386880367871743773831272945217558791867709670520632159570091273556679942194188558690863824371652669539531915581994312990167794769961244737657221122396671143145348339888308788106472726956314213678731306378350284933844004198724531538225392232209225298926342191000074318091592696527655035644027580633217085239808870166459729569875652231485870496109437295505607599301574917545303951011217758746262472258090053525770922187145661490148423928147902289750267060551777528126663244728440341531399236037845248645045749494529414359698587668031857404946489919370523756221679157359175122237772519306540269608674683717879240004803893267340482396305758047458143591664086334293012096942379962669398733948440446637417238944756499755791140482728310365361208405057637360065404060663154368075449918453718779613880795113316906626929645900669151442129735202430154440704000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000).
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2610
    self assert:(nrDiv * 1099511627776 = nr).
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2611
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2612
    divMod := nr divMod: 1099511627776.
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2613
    self assert:((divMod at:1) = nrDiv).
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2614
    self assert:((divMod at:2) = 0).
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2615
    
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2616
    divMod := nr divMod: 1099511627775.
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2617
    self assert:((divMod at:1) = (nr // 1099511627775)).
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2618
    self assert:((divMod at:2) = (nr \\ 1099511627775)).
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2619
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2620
    self assert:((divMod at:1) * 1099511627775 + (divMod at:2) = nr).
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2621
    
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2622
    "
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2623
     self basicNew testLargeDivision3
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2624
    "
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2625
!
d8800e68af7a #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
  2626
1313
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2627
testLargeDivision4
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2628
    self assert:(9000000000 \\ 4000000000)    = (900 \\ 400 * 10000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2629
    self assert:(-9000000000 \\ 4000000000)   = (-900 \\ 400 * 10000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2630
    self assert:(9000000000 \\ -4000000000)   = (900 \\ -400 * 10000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2631
    self assert:(-9000000000 \\ -4000000000)  = (-900 \\ -400 * 10000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2632
    self assert:(16000000000 \\ 4000000000)   = (1600 \\ 400 * 10000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2633
    self assert:(-16000000000 \\ 4000000000)  = (-1600 \\ 400 * 10000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2634
    self assert:(16000000000 \\ -4000000000)  = (1600 \\ -400 * 10000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2635
    self assert:(-16000000000 \\ -4000000000) = (-1600 \\ -400 * 10000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2636
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2637
    self assert:(9000000000000000000 \\ 4000000000000000000)    = (900 \\ 400 * 10000000000000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2638
    self assert:(-9000000000000000000 \\ 4000000000000000000)   = (-900 \\ 400 * 10000000000000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2639
    self assert:(9000000000000000000 \\ -4000000000000000000)   = (900 \\ -400 * 10000000000000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2640
    self assert:(-9000000000000000000 \\ -4000000000000000000)  = (-900 \\ -400 * 10000000000000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2641
    self assert:(16000000000000000000 \\ 4000000000000000000)   = (1600 \\ 400 * 10000000000000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2642
    self assert:(-16000000000000000000 \\ 4000000000000000000)  = (-1600 \\ 400 * 10000000000000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2643
    self assert:(16000000000000000000 \\ -4000000000000000000)  = (1600 \\ -400 * 10000000000000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2644
    self assert:(-16000000000000000000 \\ -4000000000000000000) = (-1600 \\ -400 * 10000000000000000).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2645
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2646
    self assert:(9000000000 \\ 7) = 5.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2647
    self assert:(-9000000000 \\ 7) = 2.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2648
    self assert:(9000000000 \\ -7) = -2.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2649
    self assert:(-9000000000 \\ -7) = -5.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2650
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2651
    self assert:(900 rem: 400) = 100.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2652
    self assert:(-900 rem: 400) = -100.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2653
    self assert:(900 rem: -400) = 100.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2654
    self assert:(-900 rem: -400) = -100.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2655
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2656
    self assert:(9000000000 rem: 4000000000) = 1000000000.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2657
    self assert:(-9000000000 rem: 4000000000) = -1000000000.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2658
    self assert:(9000000000 rem: -4000000000) = 1000000000.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2659
    self assert:(-9000000000 rem: -4000000000) = -1000000000.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2660
    
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2661
    "
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2662
     self basicNew testLargeDivision4
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2663
    "
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2664
!
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2665
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2666
testLargeDivision5
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2667
    self assert:(9000000000 quo: 4000000000)    = ((900 quo: 400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2668
    self assert:(-9000000000 quo: 4000000000)   = ((-900 quo: 400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2669
    self assert:(9000000000 quo: -4000000000)   = ((900 quo: -400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2670
    self assert:(-9000000000 quo: -4000000000)  = ((-900 quo: -400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2671
    self assert:(16000000000 quo: 4000000000)   = ((1600 quo: 400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2672
    self assert:(-16000000000 quo: 4000000000)  = ((-1600 quo: 400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2673
    self assert:(16000000000 quo: -4000000000)  = ((1600 quo: -400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2674
    self assert:(-16000000000 quo: -4000000000) = ((-1600 quo: -400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2675
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2676
    self assert:(9000000000000000000 quo: 4000000000000000000)    = ((900 quo: 400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2677
    self assert:(-9000000000000000000 quo: 4000000000000000000)   = ((-900 quo: 400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2678
    self assert:(9000000000000000000 quo: -4000000000000000000)   = ((900 quo: -400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2679
    self assert:(-9000000000000000000 quo: -4000000000000000000)  = ((-900 quo: -400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2680
    self assert:(16000000000000000000 quo: 4000000000000000000)   = ((1600 quo: 400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2681
    self assert:(-16000000000000000000 quo: 4000000000000000000)  = ((-1600 quo: 400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2682
    self assert:(16000000000000000000 quo: -4000000000000000000)  = ((1600 quo: -400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2683
    self assert:(-16000000000000000000 quo: -4000000000000000000) = ((-1600 quo: -400) ).
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2684
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2685
    self assert:(9000000000 quo: 7) = 1285714285.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2686
    self assert:(-9000000000 quo: 7) = -1285714285.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2687
    self assert:(9000000000 quo: -7) = -1285714285.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2688
    self assert:(-9000000000 quo: -7) = 1285714285.
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2689
    
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2690
    "
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2691
     self basicNew testLargeDivision5
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2692
    "
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2693
!
fa1a08692b4d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  2694
1317
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2695
testLargeDivision6
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2696
    |t|
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2697
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2698
    t := 20 factorial.
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2699
    self assert:(t = 2432902008176640000).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2700
    t := t / 20.
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2701
    self assert:(t = 19 factorial).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2702
    self assert:(t = 121645100408832000).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2703
    
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2704
    t := t / 19.
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2705
    self assert:(t = 18 factorial).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2706
    self assert:(t = 6402373705728000).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2707
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2708
    t := t / 18.
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2709
    self assert:(t = 17 factorial).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2710
    self assert:(t = 355687428096000).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2711
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2712
    t := t / 17.
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2713
    self assert:(t = 16 factorial).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2714
    self assert:(t = 20922789888000).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2715
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2716
    t := t / 16.
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2717
    self assert:(t = 15 factorial).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2718
    self assert:(t = 1307674368000).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2719
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2720
    t := t / 15.
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2721
    self assert:(t = 14 factorial).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2722
    self assert:(t = 87178291200).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2723
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2724
    t := t / 14.
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2725
    self assert:(t = 13 factorial).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2726
    self assert:(t = 6227020800).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2727
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2728
    t := t / 13.
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2729
    self assert:(t = 12 factorial).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2730
    self assert:(t = 479001600).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2731
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2732
    t := t / 12.
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2733
    self assert:(t = 11 factorial).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2734
    self assert:(t = 39916800).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2735
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2736
    t := t / 11.
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2737
    self assert:(t = 10 factorial).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2738
    self assert:(t = 3628800).
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2739
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2740
    "
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2741
     self basicNew testLargeDivision6
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2742
    "
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2743
!
2efc23013a7b #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1316
diff changeset
  2744
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2745
testLargeDivision7
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2746
    self assert:(  90000000000000000000 rem: 40000000000000000000 ) = 10000000000000000000. 
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2747
    self assert:( (((90000000000000000000 quo: 40000000000000000000)*40000000000000000000) + ( 90000000000000000000 rem: 40000000000000000000 )) = 90000000000000000000 ).
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2748
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2749
    self assert:(  -90000000000000000000 rem: 40000000000000000000 ) = -10000000000000000000. 
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2750
    self assert:( (((-90000000000000000000 quo: 40000000000000000000)*40000000000000000000) + ( -90000000000000000000 rem: 40000000000000000000 )) = -90000000000000000000 ).
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2751
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2752
    self assert:(  90000000000000000000 rem: -40000000000000000000 ) = 10000000000000000000. 
1825
026061f8fc6a #BUGFIX by sr
sr
parents: 1786
diff changeset
  2753
    self assert:( (((90000000000000000000 quo: -40000000000000000000) * -40000000000000000000) + ( 90000000000000000000 rem: -40000000000000000000 )) = 90000000000000000000 ).
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2754
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2755
    self assert:(  -90000000000000000000 rem: -40000000000000000000 ) = -10000000000000000000. 
1825
026061f8fc6a #BUGFIX by sr
sr
parents: 1786
diff changeset
  2756
    self assert:( (((-90000000000000000000 quo: -40000000000000000000) * -40000000000000000000) + ( -90000000000000000000 rem: -40000000000000000000 )) = -90000000000000000000 ).
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2757
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2758
    "
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2759
     self basicNew testLargeDivision7
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2760
    "
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2761
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2762
    "Created: / 05-07-2017 / 16:37:06 / cg"
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2763
!
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  2764
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2765
testLargeMultiplication
1528
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2766
    |t1 t2 p|
12
29d0f2e59dcb splitted into smaller methods to avoid JIT-bail-out
Claus Gittinger <cg@exept.de>
parents: 11
diff changeset
  2767
3
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2768
    "multiplication"
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2769
    t1 := 100.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2770
    self assert:(t1 * t1 == 10000).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2771
    self assert:((t1 perform:'*' asSymbol with:t1) == 10000).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2772
    self assert:((t1 * t1) printString = '10000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2773
    self assert:((t1 perform:'*' asSymbol with:t1) printString = '10000').
11
30bdd5912a36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10
diff changeset
  2774
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  2775
    t1 := 1000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2776
    self assert:(t1 * t1 == 1000000).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2777
    self assert:((t1 perform:'*' asSymbol with:t1) == 1000000).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2778
    self assert:((t1 * t1) printString = '1000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2779
    self assert:((t1 perform:'*' asSymbol with:t1) printString = '1000000').
11
30bdd5912a36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10
diff changeset
  2780
3
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2781
    t1 := 10000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2782
    self assert:(t1 * t1 == 100000000).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2783
    self assert:((t1 perform:'*' asSymbol with:t1) == 100000000).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2784
    self assert:((t1 * t1) printString = '100000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2785
    self assert:((t1 perform:'*' asSymbol with:t1) printString = '100000000').
11
30bdd5912a36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10
diff changeset
  2786
3
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2787
    t1 := 100000.
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2788
    SmallInteger maxBytes == 4 ifTrue:[
1528
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2789
        self assert:(t1 * t1 = 10000000000).
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2790
        self assert:((t1 perform:'*' asSymbol with:t1) = 10000000000).
3
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2791
    ].
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2792
    SmallInteger maxBytes == 8 ifTrue:[
1528
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2793
        self assert:(t1 * t1 == 10000000000).
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2794
        self assert:((t1 perform:'*' asSymbol with:t1) == 10000000000).
3
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2795
    ].
4
28e927bbc4e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3
diff changeset
  2796
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2797
    self assert:((t1 * t1) printString = '10000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2798
    self assert:((t1 perform:'*' asSymbol with:t1) printString = '10000000000').
11
30bdd5912a36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10
diff changeset
  2799
3
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2800
    t1 := 1000000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2801
    self assert:((t1 * t1) printString = '1000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2802
    self assert:((t1 perform:'*' asSymbol with:t1) printString = '1000000000000').
11
30bdd5912a36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10
diff changeset
  2803
3
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2804
    t1 := 10000000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2805
    self assert:((t1 * t1) printString = '100000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2806
    self assert:((t1 perform:'*' asSymbol with:t1) printString = '100000000000000').
11
30bdd5912a36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10
diff changeset
  2807
3
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2808
    t1 := 100000000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2809
    self assert:((t1 * t1) printString = '10000000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2810
    self assert:((t1 perform:'*' asSymbol with:t1) printString = '10000000000000000').
11
30bdd5912a36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10
diff changeset
  2811
3
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2812
    t1 := 1000000000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2813
    self assert:((t1 * t1) printString = '1000000000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2814
    self assert:((t1 perform:'*' asSymbol with:t1) printString = '1000000000000000000').
11
30bdd5912a36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10
diff changeset
  2815
2
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2816
3
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2817
    "Large * SmallInt multiplication"
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2818
    self assert:(10 factorial printString = '3628800').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2819
    self assert:(20 factorial printString = '2432902008176640000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2820
    self assert:(100 factorial printString = '93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2821
    self assert:(1000 factorial printString = '402387260077093773543702433923003985719374864210714632543799910429938512398629020592044208486969404800479988610197196058631666872994808558901323829669944590997424504087073759918823627727188732519779505950995276120874975462497043601418278094646496291056393887437886487337119181045825783647849977012476632889835955735432513185323958463075557409114262417474349347553428646576611667797396668820291207379143853719588249808126867838374559731746136085379534524221586593201928090878297308431392844403281231558611036976801357304216168747609675871348312025478589320767169132448426236131412508780208000261683151027341827977704784635868170164365024153691398281264810213092761244896359928705114964975419909342221566832572080821333186116811553615836546984046708975602900950537616475847728421889679646244945160765353408198901385442487984959953319101723355556602139450399736280750137837615307127761926849034352625200015888535147331611702103968175921510907788019393178114194545257223865541461062892187960223838971476088506276862967146674697562911234082439208160153780889893964518263243671616762179168909779911903754031274622289988005195444414282012187361745992642956581746628302955570299024324153181617210465832036786906117260158783520751516284225540265170483304226143974286933061690897968482590125458327168226458066526769958652682272807075781391858178889652208164348344825993266043367660176999612831860788386150279465955131156552036093988180612138558600301435694527224206344631797460594682573103790084024432438465657245014402821885252470935190620929023136493273497565513958720559654228749774011413346962715422845862377387538230483865688976461927383814900140767310446640259899490222221765904339901886018566526485061799702356193897017860040811889729918311021171229845901641921068884387121855646124960798722908519296819372388642614839657382291123125024186649353143970137428531926649875337218940694281434118520158014123344828015051399694290153483077644569099073152433278288269864602789864321139083506217095002597389863554277196742822248757586765752344220207573630569498825087968928162753848863396909959826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254742173582401063677404595741785160829230135358081840096996372524230560855903700624271243416909004153690105933983835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000').
2
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2822
940
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2823
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2824
    t2 := 100000000000000000.                   "/ large on 32bit; small on 64bt machines
1528
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2825
    p := t1 * t2.
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2826
    self assert:(p = 10000000000000000000000000).
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2827
    p := t2 * t1.
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2828
    self assert:(p = 10000000000000000000000000).
1529
32bd39e0e14e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2829
    self assert:((t1 * t2) = 10000000000000000000000000).
32bd39e0e14e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2830
    self assert:((t2 * t1) = 10000000000000000000000000).
940
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2831
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2832
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2833
    t2 := 1000000000000000000.                  "/ large on 32bit; small on 64bt machines
1529
32bd39e0e14e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2834
    p := t1 * t2.
32bd39e0e14e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2835
    self assert:(p = 100000000000000000000000000).
32bd39e0e14e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2836
    p := t2 * t1.
32bd39e0e14e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2837
    self assert:(p = 100000000000000000000000000).
940
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2838
    self assert:(t1 * t2) = 100000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2839
    self assert:(t2 * t1) = 100000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2840
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2841
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2842
    t2 := 10000000000000000000.                 "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2843
    self assert:(t1 * t2) = 1000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2844
    self assert:(t2 * t1) = 1000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2845
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2846
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2847
    t2 := 100000000000000000000.                "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2848
    self assert:(t1 * t2) = 10000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2849
    self assert:(t2 * t1) = 10000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2850
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2851
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2852
    t2 := 1000000000000000000000.               "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2853
    self assert:(t1 * t2) = 100000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2854
    self assert:(t2 * t1) = 100000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2855
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2856
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2857
    t2 := 10000000000000000000000.              "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2858
    self assert:(t1 * t2) = 1000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2859
    self assert:(t2 * t1) = 1000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2860
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2861
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2862
    t2 := 100000000000000000000000.             "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2863
    self assert:(t1 * t2) = 10000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2864
    self assert:(t2 * t1) = 10000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2865
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2866
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2867
    t2 := 1000000000000000000000000.            "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2868
    self assert:(t1 * t2) = 100000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2869
    self assert:(t2 * t1) = 100000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2870
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2871
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2872
    t2 := 10000000000000000000000000.           "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2873
    self assert:(t1 * t2) = 1000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2874
    self assert:(t2 * t1) = 1000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2875
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2876
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2877
    t2 := 100000000000000000000000000.          "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2878
    self assert:(t1 * t2) = 10000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2879
    self assert:(t2 * t1) = 10000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2880
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2881
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2882
    t2 := 1000000000000000000000000000.         "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2883
    self assert:(t1 * t2) = 100000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2884
    self assert:(t2 * t1) = 100000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2885
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2886
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2887
    t2 := 10000000000000000000000000000.        "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2888
    self assert:(t1 * t2) = 1000000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2889
    self assert:(t2 * t1) = 1000000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2890
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2891
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2892
    t2 := 100000000000000000000000000000.       "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2893
    self assert:(t1 * t2) = 10000000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2894
    self assert:(t2 * t1) = 10000000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2895
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2896
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2897
    t2 := 1000000000000000000000000000000.      "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2898
    self assert:(t1 * t2) = 100000000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2899
    self assert:(t2 * t1) = 100000000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2900
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2901
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2902
    t2 := 10000000000000000000000000000000.     "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2903
    self assert:(t1 * t2) = 1000000000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2904
    self assert:(t2 * t1) = 1000000000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2905
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2906
    t1 := 100000000.                            "/ small
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2907
    t2 := 100000000000000000000000000000000.    "/ large
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2908
    self assert:(t1 * t2) = 10000000000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2909
    self assert:(t2 * t1) = 10000000000000000000000000000000000000000.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2910
3
4def69f1ad4a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2
diff changeset
  2911
    "Large * Large multiplication"
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  2912
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2913
    self assert:((16r3FFF * 16r3FFF) hexPrintString = 'FFF8001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2914
    self assert:((16r7FFF * 16r7FFF) hexPrintString = '3FFF0001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2915
    self assert:((16rFFFF * 16rFFFF) hexPrintString = 'FFFE0001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2916
    self assert:((16r3FFFFF * 16r3FFFFF) hexPrintString = 'FFFFF800001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2917
    self assert:((16r7FFFFF * 16r7FFFFF) hexPrintString = '3FFFFF000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2918
    self assert:((16rFFFFFF * 16rFFFFFF) hexPrintString = 'FFFFFE000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2919
    self assert:((16r3FFFFFFF * 16r3FFFFFFF) hexPrintString = 'FFFFFFF80000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2920
    self assert:((16r7FFFFFFF * 16r7FFFFFFF) hexPrintString = '3FFFFFFF00000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2921
    self assert:((16rFFFFFFFF * 16rFFFFFFFF) hexPrintString = 'FFFFFFFE00000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2922
    self assert:((16r3FFFFFFFFF * 16r3FFFFFFFFF) hexPrintString = 'FFFFFFFFF8000000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2923
    self assert:((16r7FFFFFFFFF * 16r7FFFFFFFFF) hexPrintString = '3FFFFFFFFF0000000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2924
    self assert:((16rFFFFFFFFFF * 16rFFFFFFFFFF) hexPrintString = 'FFFFFFFFFE0000000001').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2925
    self assert:((20 factorial * 20 factorial) printString = '5919012181389927685417441689600000000').
7
7341cc740119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
  2926
1025
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2927
    self assert:((16rFFFFFFFFFFFF * 16rFFFFFFFFFF) hexPrintString = 'FFFFFFFFFEFF0000000001').
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2928
    self assert:((16rFFFFFFFFFFFFFF * 16rFFFFFFFFFF) hexPrintString = 'FFFFFFFFFEFFFF0000000001').
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  2929
    self assert:((t1 := 16rFFFFFFFFFFFFFFFF * 16rFFFFFFFFFF) hexPrintString = 'FFFFFFFFFEFFFFFF0000000001').
1025
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2930
    self assert:((16rFFFFFFFFFFFFFFFFFF * 16rFFFFFFFFFF) hexPrintString = 'FFFFFFFFFEFFFFFFFF0000000001').
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2931
    self assert:((16rFFFFFFFFFFFFFFFFFFFF * 16rFFFFFFFFFF) hexPrintString = 'FFFFFFFFFEFFFFFFFFFF0000000001').
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2932
    self assert:((16rFFFFFFFFFFFFFFFFFFFFFF * 16rFFFFFFFFFF) hexPrintString = 'FFFFFFFFFEFFFFFFFFFFFF0000000001').
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2933
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2934
    self assert:((16rFFFFFFFFFFFF * 16rFFFFFFFFFFFF) hexPrintString = 'FFFFFFFFFFFE000000000001').
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2935
    self assert:((16rFFFFFFFFFFFFFF * 16rFFFFFFFFFFFFFF) hexPrintString = 'FFFFFFFFFFFFFE00000000000001').
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  2936
    self assert:((t2 := (t1 := 16rFFFFFFFFFFFFFFFF * 16rFFFFFFFFFFFFFFFF) hexPrintString) = 'FFFFFFFFFFFFFFFE0000000000000001').
1025
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2937
    self assert:((16rFFFFFFFFFFFFFFFF * 16rFFFFFFFFFFFFFFFF) hexPrintString = 'FFFFFFFFFFFFFFFE0000000000000001').
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2938
    self assert:((16rFFFFFFFFFFFFFFFFFF * 16rFFFFFFFFFFFFFFFFFF) hexPrintString = 'FFFFFFFFFFFFFFFFFE000000000000000001').
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2939
    self assert:((16rFFFFFFFFFFFFFFFFFFFF * 16rFFFFFFFFFFFFFFFFFFFF) hexPrintString = 'FFFFFFFFFFFFFFFFFFFE00000000000000000001').
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2940
    self assert:((16rFFFFFFFFFFFFFFFFFFFFFF * 16rFFFFFFFFFFFFFFFFFFFFFF) hexPrintString = 'FFFFFFFFFFFFFFFFFFFFFE0000000000000000000001').
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2941
1024
17f4613fc1d4 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
  2942
    t1 := 699697179634740272935560322271216335182775596927422865716399200802062765682314102885264570100200211251370690926108604161579425545019863369232209949922751354278329212124724267803033599595114924195721823679025053720850308776953208134469115885358619139670731195605237506312288263327925364912720266772715929600.
17f4613fc1d4 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
  2943
    self assert:(t1 printString = '699697179634740272935560322271216335182775596927422865716399200802062765682314102885264570100200211251370690926108604161579425545019863369232209949922751354278329212124724267803033599595114924195721823679025053720850308776953208134469115885358619139670731195605237506312288263327925364912720266772715929600').
17f4613fc1d4 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
  2944
    self assert:((t1 * t1) = 489576143188809998144298426641311496989165214458056165805143410866108690058261346129614030084813851082564698610174813898740525406243367146120734370570458429364167811695064904353093506532695086211301649001517008746471464304183710723162864634442619484210170532881759249266026059786349673031239277666195699357198366128286910123306594912484590029738722281929300359929462301099981920256369394887701755497894820998573896950238852994224811101315810851671448056042419257789317787959570728520197146733902575090480065597582292177085754523686580725860228636039424698638422538988050350726807943014483010988455057592156160000).
17f4613fc1d4 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
  2945
    self assert:((t1 * t1) printString = '489576143188809998144298426641311496989165214458056165805143410866108690058261346129614030084813851082564698610174813898740525406243367146120734370570458429364167811695064904353093506532695086211301649001517008746471464304183710723162864634442619484210170532881759249266026059786349673031239277666195699357198366128286910123306594912484590029738722281929300359929462301099981920256369394887701755497894820998573896950238852994224811101315810851671448056042419257789317787959570728520197146733902575090480065597582292177085754523686580725860228636039424698638422538988050350726807943014483010988455057592156160000').
17f4613fc1d4 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
  2946
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  2947
    #(
1528
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2948
        16rFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2949
        16rFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2950
        16rFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2951
        16rFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2952
        16rFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2953
        16rFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2954
        16rFFFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2955
        16rFFFFFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2956
        16rFFFFFFFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2957
        16rFFFFFFFFFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2958
        16rFFFFFFFFFFFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2959
        16rFFFFFFFFFFFFFFFFFFFFFFFF
940
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2960
    ) do:[:eachFactor1 |
1528
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2961
        #(
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2962
            16rFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2963
            16rFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2964
            16rFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2965
            16rFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2966
            16rFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2967
            16rFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2968
            16rFFFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2969
            16rFFFFFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2970
            16rFFFFFFFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2971
            16rFFFFFFFFFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2972
            16rFFFFFFFFFFFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2973
            16rFFFFFFFFFFFFFFFFFFFFFFFF
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2974
        ) do:[:eachFactor2 |
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2975
            |t3|
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2976
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2977
            t1 := (eachFactor1 * eachFactor2).
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2978
            t2 := (eachFactor2 * eachFactor1).
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2979
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2980
            self assert:(t1 = t2).
940
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2981
t1 = 20203181441155852828228393631745 ifTrue:[
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2982
 eachFactor1 = 1099511627775 ifTrue:[
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2983
self halt
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2984
]].
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2985
1528
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2986
            self assert:(t1 / eachFactor1) = eachFactor2.
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2987
            self assert:(t1 / eachFactor2) = eachFactor1.
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2988
            t3 := (eachFactor1 asLargeInteger * eachFactor2 asLargeInteger).
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2989
            self assert: t1 = t3.
10ec88fdd61b #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1527
diff changeset
  2990
        ].
940
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  2991
    ].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  2992
7
7341cc740119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
  2993
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2994
     self basicNew testLargeMultiplication
7
7341cc740119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
  2995
    "
10
3cbe91972e2b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 9
diff changeset
  2996
1025
1d694c9fd79d class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  2997
    "Modified: / 02-12-2013 / 15:45:39 / cg"
7
7341cc740119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
  2998
!
7341cc740119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
  2999
1221
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3000
testLargeMultiplication2
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3001
    "tests many divisions and multiplications (of largeInts by smallInts)"
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3002
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3003
    |n n2|
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3004
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3005
    self assert:(1000 factorial printString = '402387260077093773543702433923003985719374864210714632543799910429938512398629020592044208486969404800479988610197196058631666872994808558901323829669944590997424504087073759918823627727188732519779505950995276120874975462497043601418278094646496291056393887437886487337119181045825783647849977012476632889835955735432513185323958463075557409114262417474349347553428646576611667797396668820291207379143853719588249808126867838374559731746136085379534524221586593201928090878297308431392844403281231558611036976801357304216168747609675871348312025478589320767169132448426236131412508780208000261683151027341827977704784635868170164365024153691398281264810213092761244896359928705114964975419909342221566832572080821333186116811553615836546984046708975602900950537616475847728421889679646244945160765353408198901385442487984959953319101723355556602139450399736280750137837615307127761926849034352625200015888535147331611702103968175921510907788019393178114194545257223865541461062892187960223838971476088506276862967146674697562911234082439208160153780889893964518263243671616762179168909779911903754031274622289988005195444414282012187361745992642956581746628302955570299024324153181617210465832036786906117260158783520751516284225540265170483304226143974286933061690897968482590125458327168226458066526769958652682272807075781391858178889652208164348344825993266043367660176999612831860788386150279465955131156552036093988180612138558600301435694527224206344631797460594682573103790084024432438465657245014402821885252470935190620929023136493273497565513958720559654228749774011413346962715422845862377387538230483865688976461927383814900140767310446640259899490222221765904339901886018566526485061799702356193897017860040811889729918311021171229845901641921068884387121855646124960798722908519296819372388642614839657382291123125024186649353143970137428531926649875337218940694281434118520158014123344828015051399694290153483077644569099073152433278288269864602789864321139083506217095002597389863554277196742822248757586765752344220207573630569498825087968928162753848863396909959826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254742173582401063677404595741785160829230135358081840096996372524230560855903700624271243416909004153690105933983835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000').
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3006
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3007
    n := 1000 factorial.
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3008
    1000 to:2 by:-1 do:[:d |
1786
665a0c69ecb2 #BUGFIX by sr
sr
parents: 1785
diff changeset
  3009
        n2 := n / d.
665a0c69ecb2 #BUGFIX by sr
sr
parents: 1785
diff changeset
  3010
        self assert:((d-1) factorial = n2).
665a0c69ecb2 #BUGFIX by sr
sr
parents: 1785
diff changeset
  3011
        self assert:(Integer readFrom:n2 printString) * d = n.
665a0c69ecb2 #BUGFIX by sr
sr
parents: 1785
diff changeset
  3012
        n := n2.
1221
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3013
    ].
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3014
!
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  3015
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3016
testLargeMultiplicationHelpers1
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3017
    |t1 t2 r|
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3018
1030
2115331b1845 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
  3019
    t1 := LargeInteger digitBytes:#[ 16r00 16rE1 16rF5 16r05 ].
2115331b1845 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
  3020
    t2 := LargeInteger digitBytes:#[ 16r00 16r00 16r40 16rB2 16rBA 16rC9 16rE0 16r19 16r1E 16r02].
2115331b1845 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
  3021
    r := t1 absMul:t2.
1031
247174c321e3 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
  3022
    self assert:(r printString = '1000000000000000000000000000000').
247174c321e3 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
  3023
    self assert:(r hexPrintString = 'C9F2C9CD04674EDEA40000000').
1030
2115331b1845 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1029
diff changeset
  3024
1032
ceff88dc3e56 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  3025
    t1 := LargeInteger digitBytes:#[ 16r00 16rE1 16rF5 16r05 ].
1034
19a7bdfbe204 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1033
diff changeset
  3026
    t2 := LargeInteger digitBytes:#[ 16r00 16r00 16rA0 16rDE   16rC5 16rAD 16rC9 16r35   16r36].
1032
ceff88dc3e56 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  3027
    r := t1 absMul:t2.
ceff88dc3e56 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  3028
    self assert:(r printString = '100000000000000000000000000000').
1033
5ec3c1764111 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
  3029
    self assert:(r hexPrintString = '1431E0FAE6D7217CAA0000000').
1032
ceff88dc3e56 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  3030
ceff88dc3e56 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  3031
    "/ -----
ceff88dc3e56 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  3032
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3033
    t1 := LargeInteger digitBytes:#[ 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF].
1028
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3034
    t2 := LargeInteger digitBytes:#[ 16rFF 16rFF 16rFF 16rFF 0 0 0 0].
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3035
    r := t1 absMul:t2.
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3036
    self assert:(r hexPrintString = 'FFFFFFFEFFFFFFFF00000001').
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3037
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3038
    t1 := LargeInteger digitBytes:#[ 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF].
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3039
    t2 := LargeInteger digitBytes:#[ 16rFF 16rFF 16rFF 16rFF 16rFF 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3040
    r := t1 absMul:t2.
1028
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3041
    self assert:(r printString = '20282409603633223678774030106625').
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3042
    self assert:(r hexPrintString = 'FFFFFFFFFEFFFFFF0000000001').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3043
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3044
    t1 := LargeInteger digitBytes:#[ 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3045
    t2 := LargeInteger digitBytes:#[ 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3046
    r := t1 absMul:t2.
1028
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3047
    self assert:(r printString = '5192296858534809181504947642957825').
1029
daa98cf43cf0 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  3048
    self assert:(r hexPrintString = 'FFFFFFFFFFFEFFFF000000000001').
1028
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3049
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3050
    t1 := LargeInteger digitBytes:#[ 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF].
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3051
    t2 := LargeInteger digitBytes:#[ 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 0].
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3052
    r := t1 absMul:t2.
717c303547ca class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  3053
    self assert:(r printString = '1329227995784915854385005392532865025').
1029
daa98cf43cf0 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  3054
    self assert:(r hexPrintString = 'FFFFFFFFFFFFFEFF00000000000001').
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3055
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3056
    "
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3057
     self basicNew testLargeMultiplicationHelpers1
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3058
    "
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3059
1033
5ec3c1764111 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
  3060
    "Modified: / 02-12-2013 / 18:48:00 / cg"
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3061
!
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3062
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3063
testLargeMultiplicationHelpers2
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3064
    |t1 t2 r|
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3065
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3066
    "/ testing internal multiplication method
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3067
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3068
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3069
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3070
    self assert:(r hexPrintString = '100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3071
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3072
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3073
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3074
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3075
    self assert:(r hexPrintString = '12100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3076
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3077
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3078
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3079
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3080
    self assert:(r hexPrintString = '1412100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3081
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3082
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10 11].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3083
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3084
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3085
    self assert:(r hexPrintString = '161412100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3086
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3087
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10 11 12].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3088
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3089
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3090
    self assert:(r hexPrintString = '18161412100E0C0A08060402').
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3091
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3092
    "/ --------
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3093
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3094
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3095
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3096
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3097
    self assert:(r hexPrintString = '100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3098
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3099
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3100
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3101
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3102
    self assert:(r hexPrintString = '12100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3103
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3104
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3105
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3106
    r := t1 absMul:t2.
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3107
    self assert:(r hexPrintString = '1412100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3108
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3109
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10 11].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3110
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3111
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3112
    self assert:(r hexPrintString = '161412100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3113
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3114
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10 11 12].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3115
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3116
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3117
    self assert:(r hexPrintString = '18161412100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3118
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3119
    "/ --------
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3120
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3121
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3122
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3123
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3124
    self assert:(r hexPrintString = '100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3125
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3126
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3127
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3128
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3129
    self assert:(r hexPrintString = '12100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3130
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3131
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3132
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0 ].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3133
    r := t1 absMul:t2.
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3134
    self assert:(r hexPrintString = '1412100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3135
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3136
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10 11].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3137
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3138
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3139
    self assert:(r hexPrintString = '161412100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3140
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3141
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10 11 12].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3142
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3143
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3144
    self assert:(r hexPrintString = '18161412100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3145
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3146
    "/ --------
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3147
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3148
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3149
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3150
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3151
    self assert:(r hexPrintString = '100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3152
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3153
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3154
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3155
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3156
    self assert:(r hexPrintString = '12100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3157
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3158
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3159
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0 0].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3160
    r := t1 absMul:t2.
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3161
    self assert:(r hexPrintString = '1412100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3162
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3163
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10 11].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3164
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3165
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3166
    self assert:(r hexPrintString = '161412100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3167
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3168
    t1 := LargeInteger digitBytes:#[ 1 2 3 4 5 6 7 8 9 10 11 12].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3169
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3170
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3171
    self assert:(r hexPrintString = '18161412100E0C0A08060402').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3172
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3173
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3174
    "/ ==================0
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3175
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3176
    t1 := LargeInteger digitBytes:#[ 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3177
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3178
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3179
    self assert:(r hexPrintString = '202020202020300').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3180
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3181
    t1 := LargeInteger digitBytes:#[ 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3182
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3183
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3184
    self assert:(r hexPrintString = '202020202020300').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3185
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3186
    t1 := LargeInteger digitBytes:#[ 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3187
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3188
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3189
    self assert:(r hexPrintString = '202020202020300').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3190
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3191
    t1 := LargeInteger digitBytes:#[ 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3192
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3193
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3194
    self assert:(r hexPrintString = '202020202020300').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3195
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3196
    "/ ---------
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3197
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3198
    t1 := LargeInteger digitBytes:#[ 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3199
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3200
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3201
    self assert:(r hexPrintString = '20202020202030000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3202
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3203
    t1 := LargeInteger digitBytes:#[ 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3204
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3205
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3206
    self assert:(r hexPrintString = '20202020202030000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3207
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3208
    t1 := LargeInteger digitBytes:#[ 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3209
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3210
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3211
    self assert:(r hexPrintString = '20202020202030000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3212
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3213
    t1 := LargeInteger digitBytes:#[ 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3214
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3215
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3216
    self assert:(r hexPrintString = '20202020202030000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3217
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3218
    "/ ---------
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3219
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3220
    t1 := LargeInteger digitBytes:#[ 0 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3221
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3222
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3223
    self assert:(r hexPrintString = '2020202020203000000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3224
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3225
    t1 := LargeInteger digitBytes:#[ 0 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3226
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3227
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3228
    self assert:(r hexPrintString = '2020202020203000000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3229
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3230
    t1 := LargeInteger digitBytes:#[ 0 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3231
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3232
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3233
    self assert:(r hexPrintString = '2020202020203000000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3234
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3235
    t1 := LargeInteger digitBytes:#[ 0 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3236
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3237
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3238
    self assert:(r hexPrintString = '2020202020203000000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3239
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3240
    "/ ---------
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3241
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3242
    t1 := LargeInteger digitBytes:#[ 0 0 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3243
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3244
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3245
    self assert:(r hexPrintString = '202020202020300000000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3246
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3247
    t1 := LargeInteger digitBytes:#[ 0 0 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3248
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3249
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3250
    self assert:(r hexPrintString = '202020202020300000000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3251
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3252
    t1 := LargeInteger digitBytes:#[ 0 0 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3253
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3254
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3255
    self assert:(r hexPrintString = '202020202020300000000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3256
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3257
    t1 := LargeInteger digitBytes:#[ 0 0 0 128 1 1 1 1 1 1 1].
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3258
    t2 := LargeInteger digitBytes:#[ 2 0 0 0 0 0 0 0 0 0 0].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  3259
    r := t1 absMul:t2.
1026
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3260
    self assert:(r hexPrintString = '202020202020300000000').
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3261
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3262
    "
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3263
     self basicNew testLargeMultiplicationHelpers2
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3264
    "
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3265
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3266
    "Modified: / 02-12-2013 / 15:45:39 / cg"
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3267
!
babb7ffa347e class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3268
335
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3269
testLargeSubtraction1
336
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3270
    |a1 a2 a b1 b2 b c1 c2 c|
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3271
937
93ad4e077877 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  3272
    "/ on 32bit machines - these lead to smallint overflow
335
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3273
    self assert:((2770568 + 2770568) printString = '5541136').
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3274
    self assert:((2770568 - 2770568) printString = '0').
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3275
    self assert:((2770568 negated + 2770568 negated) printString = '-5541136').
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3276
    self assert:((5541136 negated - 2770568 negated) printString = '-2770568').
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3277
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3278
    "Large - small subtraction"
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3279
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3280
    self assert:((2770568900 + 2770568900) printString = '5541137800').
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3281
    self assert:((2770568900 - 2770568900) printString = '0').
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3282
    self assert:((2770568900 negated + 2770568900 negated) printString = '-5541137800').
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3283
    self assert:((5541137800 negated - 2770568900 negated) printString = '-2770568900').
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3284
    self assert:((2770568900 negated - 5541137800 negated) printString = '2770568900').
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3285
336
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3286
    a1 := -2770568900. a2 := 59049.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3287
    a := (a1 / a2) negated.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3288
    b1 := -5872025600. b2 := 59049.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3289
    b := (b1 / b2) negated.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3290
    c1 := 344606300. c2 := 6561.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3291
    c := (c1 / c2) negated.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3292
    self assert:(a - b closeTo: c).
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3293
    self assert:((a - b) asFloat closeTo: c asFloat).
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3294
    self assert:((a asFloat - b) closeTo: c asFloat).
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3295
    self assert:((a - b asFloat) closeTo: c asFloat).
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3296
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3297
    a := -10.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3298
    b := -12.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3299
    self assert:(a - b = 2).
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3300
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3301
    a := -10000000.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3302
    b := -12000000.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3303
    self assert:(a - b = 2000000).
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3304
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3305
    a := -100000000000000.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3306
    b := -120000000000000.
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3307
    self assert:(a - b = 20000000000000).
031ea06f1959 more checks
sr
parents: 335
diff changeset
  3308
337
c0fbd5e3dd76 more checks
sr
parents: 336
diff changeset
  3309
    "smallInteger - largeInteger"
c0fbd5e3dd76 more checks
sr
parents: 336
diff changeset
  3310
    self assert:(-1000000000 - -2000000000 = 1000000000).
c0fbd5e3dd76 more checks
sr
parents: 336
diff changeset
  3311
    "largeInteger - smallInteger"
c0fbd5e3dd76 more checks
sr
parents: 336
diff changeset
  3312
    self assert:(-2000000000 - -1000000000 = -1000000000).
c0fbd5e3dd76 more checks
sr
parents: 336
diff changeset
  3313
940
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3314
    a := 40 factorial.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3315
    b := 39 factorial.
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3316
    self assert:(a - b + b = a).
f0b195f99e55 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3317
335
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3318
    "
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3319
     self basicNew testLargeSubtraction1
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3320
    "
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3321
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3322
    "Modified: / 27.11.1999 / 16:41:54 / cg"
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3323
!
bdafaceb889a oops - largeInteger subtraction
sr
parents: 316
diff changeset
  3324
937
93ad4e077877 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  3325
testLargeSubtraction2
93ad4e077877 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  3326
    "/ on 64bit machines - these lead to smallint overflow
93ad4e077877 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  3327
    self assert:((16r3FFFFFFFFFFFFFFF negated - 1 - 1) printString = '-4611686018427387905').
93ad4e077877 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  3328
93ad4e077877 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  3329
    "
93ad4e077877 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  3330
     self basicNew testLargeSubtraction2
93ad4e077877 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  3331
    "
93ad4e077877 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  3332
!
93ad4e077877 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  3333
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3334
testModulu
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3335
    |a b op|
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3336
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3337
    op := #\\.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3338
    a := -1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3339
    b := 8.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3340
    self assert:(-1 \\ 8 == 7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3341
    self assert:(a \\ 8 == 7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3342
    self assert:(-1 \\ b == 7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3343
    self assert:(a \\ b == 7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3344
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3345
    self assert:((-1 perform:op with: 8) == 7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3346
    self assert:((a perform:op with: 8) == 7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3347
    self assert:((-1 perform:op with: b) == 7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3348
    self assert:((a perform:op with: b) == 7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3349
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3350
    a := 1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3351
    b := -8.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3352
    self assert:(1 \\ -8 == -7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3353
    self assert:(a \\ -8 == -7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3354
    self assert:(1 \\ b == -7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3355
    self assert:(a \\ b == -7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3356
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3357
    self assert:((1 perform:op with: -8) == -7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3358
    self assert:((a perform:op with: -8) == -7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3359
    self assert:((1 perform:op with: b) == -7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3360
    self assert:((a perform:op with: b) == -7).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3361
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3362
    a := -1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3363
    b := -8.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3364
    self assert:(-1 \\ -8 == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3365
    self assert:(a \\ -8 == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3366
    self assert:(-1 \\ b == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3367
    self assert:(a \\ b == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3368
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3369
    self assert:((-1 perform:op with: -8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3370
    self assert:((a perform:op with: -8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3371
    self assert:((-1 perform:op with: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3372
    self assert:((a perform:op with: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3373
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3374
    a := 1.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3375
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3376
    self assert:(1 \\ 8 == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3377
    self assert:(a \\ 8 == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3378
    self assert:(1 \\ b == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3379
    self assert:(a \\ b == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3380
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3381
    self assert:((1 perform:op with: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3382
    self assert:((a perform:op with: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3383
    self assert:((1 perform:op with: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3384
    self assert:((a perform:op with: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3385
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3386
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3387
    a := -17.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3388
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3389
    self assert:(-17 \\ 8 == 7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3390
    self assert:(a \\ 8 == 7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3391
    self assert:(-17 \\ b == 7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3392
    self assert:(a \\ b == 7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3393
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3394
    self assert:((-17 perform:op with: 8) == 7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3395
    self assert:((a perform:op with: 8) == 7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3396
    self assert:((-17 perform:op with: b) == 7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3397
    self assert:((a perform:op with: b) == 7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3398
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3399
    a := 17.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3400
    b := -8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3401
    self assert:(17 \\ -8 == -7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3402
    self assert:(a \\ -8 == -7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3403
    self assert:(17 \\ b == -7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3404
    self assert:(a \\ b == -7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3405
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3406
    self assert:((17 perform:op with: -8) == -7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3407
    self assert:((a perform:op with: -8) == -7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3408
    self assert:((17 perform:op with: b) == -7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3409
    self assert:((a perform:op with: b) == -7).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3410
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3411
    a := -17.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3412
    b := -8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3413
    self assert:(-17 \\ -8 == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3414
    self assert:(a \\ -8 == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3415
    self assert:(-17 \\ b == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3416
    self assert:(a \\ b == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3417
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3418
    self assert:((-17 perform:op with: -8) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3419
    self assert:((a perform:op with: -8) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3420
    self assert:((-17 perform:op with: b) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3421
    self assert:((a perform:op with: b) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3422
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3423
    a := 17.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3424
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3425
    self assert:(17 \\ 8 == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3426
    self assert:(a \\ 8 == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3427
    self assert:(17 \\ b == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3428
    self assert:(a \\ b == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3429
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3430
    self assert:((17 perform:op with: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3431
    self assert:((a perform:op with: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3432
    self assert:((17 perform:op with: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3433
    self assert:((a perform:op with: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3434
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3435
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3436
    op := #rem:.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3437
    a := -1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3438
    b := 8.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3439
    self assert:((-1 rem: 8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3440
    self assert:((a rem: 8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3441
    self assert:((-1 rem: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3442
    self assert:((a rem: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3443
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3444
    self assert:((-1 perform:op with: -8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3445
    self assert:((a perform:op with: -8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3446
    self assert:((-1 perform:op with: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3447
    self assert:((a perform:op with: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3448
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3449
    a := 1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3450
    b := -8.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3451
    self assert:((1 rem: -8) == 1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3452
    self assert:((a rem: -8) == 1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3453
    self assert:((1 rem: b) == 1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3454
    self assert:((a rem: b) == 1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3455
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3456
    self assert:((1 perform:op with: -8) == 1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3457
    self assert:((a perform:op with: -8) == 1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3458
    self assert:((1 perform:op with: b) == 1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3459
    self assert:((a perform:op with: b) == 1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3460
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3461
    a := -1.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3462
    b := -8.
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3463
    self assert:((-1 rem: -8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3464
    self assert:((a rem: -8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3465
    self assert:((-1 rem: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3466
    self assert:((a rem: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3467
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3468
    self assert:((-1 perform:op with: -8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3469
    self assert:((a perform:op with: -8) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3470
    self assert:((-1 perform:op with: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3471
    self assert:((a perform:op with: b) == -1).
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3472
150
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3473
    a := 1.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3474
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3475
    self assert:((1 rem: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3476
    self assert:((a rem: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3477
    self assert:((1 rem: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3478
    self assert:((a rem: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3479
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3480
    self assert:((1 perform:op with: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3481
    self assert:((a perform:op with: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3482
    self assert:((1 perform:op with: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3483
    self assert:((a perform:op with: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3484
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3485
    a := -17.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3486
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3487
    self assert:((-17 rem: 8) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3488
    self assert:((a rem: 8) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3489
    self assert:((-17 rem: b) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3490
    self assert:((a rem: b) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3491
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3492
    self assert:((-17 perform:op with: -8) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3493
    self assert:((a perform:op with: -8) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3494
    self assert:((-17 perform:op with: b) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3495
    self assert:((a perform:op with: b) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3496
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3497
    a := 17.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3498
    b := -8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3499
    self assert:((17 rem: -8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3500
    self assert:((a rem: -8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3501
    self assert:((17 rem: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3502
    self assert:((a rem: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3503
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3504
    self assert:((17 perform:op with: -8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3505
    self assert:((a perform:op with: -8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3506
    self assert:((17 perform:op with: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3507
    self assert:((a perform:op with: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3508
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3509
    a := -17.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3510
    b := -8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3511
    self assert:((-17 rem: -8) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3512
    self assert:((a rem: -8) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3513
    self assert:((-17 rem: b) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3514
    self assert:((a rem: b) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3515
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3516
    self assert:((-17 perform:op with: -8) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3517
    self assert:((a perform:op with: -8) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3518
    self assert:((-17 perform:op with: b) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3519
    self assert:((a perform:op with: b) == -1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3520
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3521
    a := 17.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3522
    b := 8.
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3523
    self assert:((17 rem: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3524
    self assert:((a rem: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3525
    self assert:((17 rem: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3526
    self assert:((a rem: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3527
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3528
    self assert:((17 perform:op with: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3529
    self assert:((a perform:op with: 8) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3530
    self assert:((17 perform:op with: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3531
    self assert:((a perform:op with: b) == 1).
a57daf60d4f2 more modulu & division tests
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  3532
112
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3533
    "
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3534
     self basicNew testModulu
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3535
    "
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3536
!
e3bd6adcc7cf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 107
diff changeset
  3537
1832
672ae0ade75c #FEATURE by sr
sr
parents: 1831
diff changeset
  3538
testNegation
672ae0ade75c #FEATURE by sr
sr
parents: 1831
diff changeset
  3539
    self assert:(self doNegate:SmallInteger minVal) class = LargeInteger.
672ae0ade75c #FEATURE by sr
sr
parents: 1831
diff changeset
  3540
    self assert:(self doNegate:SmallInteger minVal) = (SmallInteger maxVal + 1).
1833
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
  3541
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
  3542
    self assert:(self doNegate2:SmallInteger minVal) class = LargeInteger.
5c67361eefeb #FEATURE by sr
sr
parents: 1832
diff changeset
  3543
    self assert:(self doNegate2:SmallInteger minVal) = (SmallInteger maxVal + 1).
1832
672ae0ade75c #FEATURE by sr
sr
parents: 1831
diff changeset
  3544
!
672ae0ade75c #FEATURE by sr
sr
parents: 1831
diff changeset
  3545
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3546
testSmallIntegerArithmetic
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3547
    "arithmetic tests.
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3548
     Notice, the arithmetic tests are both performed via regular sends
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3549
     and via constructed performs. The reason is to test both inlined
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3550
     JIT-compiler code AND the regular methods code."
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3551
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  3552
    |n1 n2 t|
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3553
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3554
    "/ test division and modulu ...
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3555
    self assert:(1 printString = '1').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3556
    self assert:(10 printString = '10').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3557
    self assert:(100 printString = '100').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3558
    self assert:(1000 printString = '1000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3559
    self assert:(10000 printString = '10000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3560
    self assert:(100000 printString = '100000').
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3561
1900
82127002ff24 #QUALITY by mawalch
mawalch
parents: 1833
diff changeset
  3562
    self assert:(1 - 1 = 0).
82127002ff24 #QUALITY by mawalch
mawalch
parents: 1833
diff changeset
  3563
    self assert:(1 + -1 = 0).
82127002ff24 #QUALITY by mawalch
mawalch
parents: 1833
diff changeset
  3564
    self assert:(-1 + 1 = 0).
82127002ff24 #QUALITY by mawalch
mawalch
parents: 1833
diff changeset
  3565
    self assert:(-1 - -1 = 0).
82127002ff24 #QUALITY by mawalch
mawalch
parents: 1833
diff changeset
  3566
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3567
    "addition with overflow"
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3568
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3569
    SmallInteger maxBytes == 4 ifTrue:[
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  3570
        n1 := 16r3FFFFFFF.
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  3571
        n2 := 16r-40000000.
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3572
    ] ifFalse:[
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  3573
        n1 := 16r3FFFFFFFFFFFFFFF.
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  3574
        n2 := 16r-4000000000000000.
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3575
    ].
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3576
    self assert:(n1 class == SmallInteger).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3577
    self assert:(n2 class == SmallInteger).
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3578
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3579
    self assert:((n1 + 1) class == LargeInteger).
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3580
    t := n1 + 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3581
    self assert:((t - 1) class == SmallInteger).
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3582
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3583
    self assert:((n2 - 1) class == LargeInteger).
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3584
    t := n2 - 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3585
    self assert:((t + 1) class == SmallInteger).
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3586
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3587
    self assert:((n1 negated) class == SmallInteger).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3588
    self assert:((n2 negated) class == LargeInteger).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3589
    self assert:((n1 perform:'negated' asSymbol) class == SmallInteger).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3590
    self assert:((n2 perform:'negated' asSymbol) class == LargeInteger).
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3591
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3592
    self assert:((n1 abs == n1)).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3593
    self assert:((n2 abs = n2 negated)).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3594
    self assert:((n1 perform:'abs' asSymbol) == n1).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3595
    self assert:((n2 perform:'abs' asSymbol) = n2 negated).
28
fca649220051 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 27
diff changeset
  3596
38
d9e56dee842c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 37
diff changeset
  3597
    self testSmallIntegerMultiplication1.
d9e56dee842c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 37
diff changeset
  3598
    self testSmallIntegerMultiplication1b.
d9e56dee842c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 37
diff changeset
  3599
    self testSmallIntegerMultiplication2.
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3600
    self testSmallIntegerDivision1.
38
d9e56dee842c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 37
diff changeset
  3601
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3602
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3603
     self basicNew testSmallIntegerArithmetic
27
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3604
    "
8386e8469cdf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 26
diff changeset
  3605
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  3606
    "Created: / 06-06-1999 / 14:47:51 / cg"
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  3607
    "Modified: / 09-06-1999 / 17:49:57 / cg"
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  3608
    "Modified (format): / 19-09-2017 / 16:28:09 / stefan"
1900
82127002ff24 #QUALITY by mawalch
mawalch
parents: 1833
diff changeset
  3609
    "Modified: / 12-03-2018 / 16:18:59 / mawalch"
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3610
!
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3611
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3612
testSmallIntegerDivision1
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3613
    "division tests.
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3614
     Notice, the arithmetic tests are both performed via regular sends
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3615
     and via constructed performs. The reason is to test both inlined
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3616
     JIT-compiler code AND the regular methods code."
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3617
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3618
    |n1 n2|
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3619
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3620
    n1 := 1000.
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3621
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3622
    "/ truncation towards...
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3623
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3624
    "/ ... negative infinity
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3625
    n2 := 3.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3626
    self assert:((n1 // n2) == 333).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3627
    self assert:((n1 // n2) printString = '333').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3628
    self assert:((n1 perform:'//' asSymbol with:n2) == 333).
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3629
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3630
    n2 := -3.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3631
    self assert:((n1 // n2) == -334).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3632
    self assert:((n1 // n2) printString = '-334').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3633
    self assert:((n1 perform:'//' asSymbol with:n2) == -334).
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3634
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3635
    n2 := 3600000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3636
    self assert:((n1 // n2) == 0).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3637
    self assert:((n1 // n2) printString = '0').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3638
    self assert:((n1 perform:'//' asSymbol with:n2) == 0).
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3639
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3640
    n2 := -3600000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3641
    self assert:((n1 // n2) == -1).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3642
    self assert:((n1 // n2) printString = '-1').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3643
    self assert:((n1 perform:'//' asSymbol with:n2) == -1).
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3644
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3645
    self assert:( (9000000000 \\ 4000000000)   = (900 \\ 400 * 10000000)).
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3646
    self assert:( (-9000000000 \\ 4000000000)  = (-900 \\ 400 * 10000000)).
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3647
    self assert:( (9000000000 \\ -4000000000)  = (900 \\ -400 * 10000000)).
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3648
    self assert:( (-9000000000 \\ -4000000000) = (-900 \\ -400 * 10000000)).
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3649
    self assert:( (16000000000 \\ 4000000000)  = (1600 \\ 400 * 10000000)).
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3650
    self assert:( (-16000000000 \\ 4000000000)  = (-1600 \\ 400 * 10000000)).
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3651
    self assert:( (16000000000 \\ -4000000000)  = (1600 \\ -400 * 10000000)).
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3652
    self assert:( (-16000000000 \\ -4000000000)  = (-1600 \\ -400 * 10000000)).
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3653
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3654
    self assert:(( 9000000000 \\ 7 ) == 5).
1827
ede30a444a9f #BUGFIX by sr
sr
parents: 1826
diff changeset
  3655
    self assert:( (((9000000000 // 7)*  7) + (9000000000 \\ 7)) = 9000000000 ).
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3656
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3657
    self assert:(( -9000000000 \\ 7) == 2).
1827
ede30a444a9f #BUGFIX by sr
sr
parents: 1826
diff changeset
  3658
    self assert:( (((-9000000000 // 7) * 7) + (-9000000000 \\ 7)) = -9000000000 ).
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3659
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3660
    self assert:(( 9000000000 \\ -7) == -2).
1827
ede30a444a9f #BUGFIX by sr
sr
parents: 1826
diff changeset
  3661
    self assert:( (((9000000000 // -7) * -7) + (9000000000 \\ -7)) = 9000000000 ).
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3662
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3663
    self assert:(( -9000000000 \\ -7) == -5).
1827
ede30a444a9f #BUGFIX by sr
sr
parents: 1826
diff changeset
  3664
    self assert:( (((-9000000000 // -7) * -7) + (-9000000000 \\ -7)) = -9000000000 ).
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3665
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3666
    "/ ---------------------------
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3667
    "/ towards zero
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3668
    n2 := 3.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3669
    self assert:((n1 quo: n2) == 333).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3670
    self assert:((n1 quo: n2) printString = '333').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3671
    self assert:((n1 perform:'quo:' asSymbol with:n2) == 333).
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3672
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3673
    n2 := -3.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3674
    self assert:((n1 quo: n2) == -333).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3675
    self assert:((n1 quo: n2) printString = '-333').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3676
    self assert:((n1 perform:'quo:' asSymbol with:n2) == -333).
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3677
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3678
    n2 := 3600000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3679
    self assert:((n1 quo: n2) == 0).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3680
    self assert:((n1 quo: n2) printString = '0').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3681
    self assert:((n1 perform:'quo:' asSymbol with:n2) == 0).
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3682
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3683
    n2 := -3600000.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3684
    self assert:((n1 quo: n2) == 0).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3685
    self assert:((n1 quo: n2) printString = '0').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3686
    self assert:((n1 perform:'quo:' asSymbol with:n2) == 0).
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3687
1631
6e979d0e83d7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
  3688
    self assert:( 900 rem: 400 ) == 100.
1827
ede30a444a9f #BUGFIX by sr
sr
parents: 1826
diff changeset
  3689
    self assert:( (((900 quo: 400) * 400) + ( 900 rem: 400 )) == 900 ).
1631
6e979d0e83d7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
  3690
6e979d0e83d7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
  3691
    self assert:( -900 rem: 400) == -100.  
1827
ede30a444a9f #BUGFIX by sr
sr
parents: 1826
diff changeset
  3692
    self assert:( (((-900 quo: 400) * 400) + ( -900 rem: 400 )) == -900 ).
1631
6e979d0e83d7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
  3693
6e979d0e83d7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
  3694
    self assert:( 900 rem: -400) == 100.  
1827
ede30a444a9f #BUGFIX by sr
sr
parents: 1826
diff changeset
  3695
    self assert:( (((900 quo: -400) * -400) + ( 900 rem: -400 )) == 900 ).
1631
6e979d0e83d7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
  3696
6e979d0e83d7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
  3697
    self assert:( -900 rem: -400) == -100.  
1827
ede30a444a9f #BUGFIX by sr
sr
parents: 1826
diff changeset
  3698
    self assert:( (((-900 quo: -400) * -400) + ( -900 rem: -400 )) == -900 ).
1631
6e979d0e83d7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
  3699
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3700
    self assert:(  9000000000 rem: 4000000000 ) = 1000000000. 
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3701
    self assert:( (((9000000000 quo: 4000000000)*4000000000) + ( 9000000000 rem: 4000000000 )) = 9000000000 ).
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3702
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3703
    self assert:(  -9000000000 rem: 4000000000 ) = -1000000000. 
1827
ede30a444a9f #BUGFIX by sr
sr
parents: 1826
diff changeset
  3704
    self assert:( (((-9000000000 quo: 4000000000) * 4000000000) + ( -9000000000 rem: 4000000000 )) = -9000000000 ).
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3705
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3706
    self assert:(  9000000000 rem: -4000000000 ) = 1000000000. 
1827
ede30a444a9f #BUGFIX by sr
sr
parents: 1826
diff changeset
  3707
    self assert:( (((9000000000 quo: -4000000000) * -4000000000) + ( 9000000000 rem: -4000000000 )) = 9000000000 ).
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3708
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3709
    self assert:(  -9000000000 rem: -4000000000 ) = -1000000000. 
1827
ede30a444a9f #BUGFIX by sr
sr
parents: 1826
diff changeset
  3710
    self assert:( (((-9000000000 quo: -4000000000) * -4000000000) + ( -9000000000 rem: -4000000000 )) = -9000000000 ).
1631
6e979d0e83d7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
  3711
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3712
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3713
     self basicNew testSmallIntegerDivision1
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3714
    "
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3715
1631
6e979d0e83d7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1630
diff changeset
  3716
    "Created: / 09-06-1999 / 17:49:45 / cg"
1632
f399ca3f36d8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 1631
diff changeset
  3717
    "Modified: / 05-07-2017 / 16:38:27 / cg"
46
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3718
!
cfc40ffac21a added division checks
Claus Gittinger <cg@exept.de>
parents: 45
diff changeset
  3719
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3720
testSmallIntegerMultiplication1
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  3721
    "multiply tests (var * const).
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3722
     Notice, the arithmetic tests are both performed via regular sends
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3723
     and via constructed performs. The reason is to test both inlined
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3724
     JIT-compiler code AND the regular methods code."
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3725
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  3726
    |n1 n2|
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3727
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3728
    n1 := 100000.
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3729
    n2 := n1 negated.
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3730
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3731
    self assert:(n1 printString = '100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3732
    self assert:(n2 printString = '-100000').
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3733
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3734
    self assert:((n1 * 0) printString = '0').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3735
    self assert:((n1 perform:'*' asSymbol with:0) printString = '0').
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3736
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3737
    self assert:((n1 * 1) printString = '100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3738
    self assert:((n1 perform:'*' asSymbol with:1) printString = '100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3739
    self assert:((n2 * 1) printString = '-100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3740
    self assert:((n2 perform:'*' asSymbol with:1) printString = '-100000').
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3741
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3742
    self assert:((n1 * -1) printString = '-100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3743
    self assert:((n1 perform:'*' asSymbol with:-1) printString = '-100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3744
    self assert:((n2 * -1) printString = '100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3745
    self assert:((n2 perform:'*' asSymbol with:-1) printString = '100000').
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3746
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3747
    self assert:((n1 * 2) printString = '200000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3748
    self assert:((n1 perform:'*' asSymbol with:2) printString = '200000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3749
    self assert:((n1 * 3) printString = '300000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3750
    self assert:((n1 perform:'*' asSymbol with:3) printString = '300000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3751
    self assert:((n1 * 4) printString = '400000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3752
    self assert:((n1 perform:'*' asSymbol with:4) printString = '400000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3753
    self assert:((n1 * 5) printString = '500000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3754
    self assert:((n1 perform:'*' asSymbol with:5) printString = '500000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3755
    self assert:((n1 * 6) printString = '600000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3756
    self assert:((n1 perform:'*' asSymbol with:6) printString = '600000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3757
    self assert:((n1 * 7) printString = '700000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3758
    self assert:((n1 perform:'*' asSymbol with:7) printString = '700000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3759
    self assert:((n1 * 8) printString = '800000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3760
    self assert:((n1 perform:'*' asSymbol with:8) printString = '800000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3761
    self assert:((n1 * 9) printString = '900000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3762
    self assert:((n1 perform:'*' asSymbol with:9) printString = '900000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3763
    self assert:((n1 * 10) printString = '1000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3764
    self assert:((n1 perform:'*' asSymbol with:10) printString = '1000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3765
    self assert:((n1 * 11) printString = '1100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3766
    self assert:((n1 perform:'*' asSymbol with:11) printString = '1100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3767
    self assert:((n1 * 12) printString = '1200000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3768
    self assert:((n1 perform:'*' asSymbol with:12) printString = '1200000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3769
    self assert:((n1 * 13) printString = '1300000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3770
    self assert:((n1 perform:'*' asSymbol with:13) printString = '1300000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3771
    self assert:((n1 * 14) printString = '1400000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3772
    self assert:((n1 perform:'*' asSymbol with:14) printString = '1400000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3773
    self assert:((n1 * 15) printString = '1500000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3774
    self assert:((n1 perform:'*' asSymbol with:15) printString = '1500000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3775
    self assert:((n1 * 16) printString = '1600000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3776
    self assert:((n1 perform:'*' asSymbol with:16) printString = '1600000').
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3777
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3778
    n1 := 1.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3779
    n2 := 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3780
    self assert:((n1 * n2) printString = '10').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3781
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3782
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3783
    self assert:((n1 * n2) printString = '100').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3784
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3785
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3786
    self assert:((n1 * n2) printString = '1000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3787
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3788
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3789
    self assert:((n1 * n2) printString = '10000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3790
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3791
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3792
    self assert:((n1 * n2) printString = '100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3793
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3794
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3795
    self assert:((n1 * n2) printString = '1000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3796
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3797
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3798
    self assert:((n1 * n2) printString = '10000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3799
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3800
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3801
    self assert:((n1 * n2) printString = '100000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3802
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3803
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3804
    self assert:((n1 * n2) printString = '1000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3805
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3806
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3807
    self assert:((n1 * n2) printString = '10000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3808
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3809
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3810
    self assert:((n1 * n2) printString = '100000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3811
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3812
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3813
    self assert:((n1 * n2) printString = '1000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3814
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3815
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3816
    self assert:((n1 * n2) printString = '10000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3817
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3818
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3819
    n1 := 1.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3820
    n2 := 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3821
    self assert:((n1 * n2) printString = '10').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3822
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3823
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3824
    self assert:((n1 * n2) printString = '100').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3825
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3826
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3827
    self assert:((n1 * n2) printString = '1000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3828
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3829
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3830
    self assert:((n1 * n2) printString = '10000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3831
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3832
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3833
    self assert:((n1 * n2) printString = '100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3834
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3835
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3836
    self assert:((n1 * n2) printString = '1000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3837
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3838
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3839
    self assert:((n1 * n2) printString = '10000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3840
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3841
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3842
    self assert:((n1 * n2) printString = '100000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3843
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3844
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3845
    self assert:((n1 * n2) printString = '1000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3846
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3847
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3848
    self assert:((n1 * n2) printString = '10000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3849
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3850
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3851
    self assert:((n1 * n2) printString = '100000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3852
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3853
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3854
    self assert:((n1 * n2) printString = '1000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3855
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3856
    n1 := n1 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3857
    self assert:((n1 * n2) printString = '10000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3858
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3859
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3860
    n1 := 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3861
    n2 := 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3862
    self assert:((n1 * n2) printString = '100').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3863
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3864
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3865
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3866
    self assert:((n1 * n2) printString = '10000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3867
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3868
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3869
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3870
    self assert:((n1 * n2) printString = '1000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3871
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3872
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3873
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3874
    self assert:((n1 * n2) printString = '100000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3875
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3876
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3877
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3878
    self assert:((n1 * n2) printString = '10000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3879
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3880
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3881
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3882
    self assert:((n1 * n2) printString = '1000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3883
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3884
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3885
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3886
    self assert:((n1 * n2) printString = '100000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3887
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3888
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3889
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3890
    self assert:((n1 * n2) printString = '10000000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3891
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3892
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3893
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3894
    self assert:((n1 * n2) printString = '1000000000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3895
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000000000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3896
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3897
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3898
    self assert:((n1 * n2) printString = '100000000000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3899
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100000000000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3900
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3901
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3902
    self assert:((n1 * n2) printString = '10000000000000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3903
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '10000000000000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3904
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3905
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3906
    self assert:((n1 * n2) printString = '1000000000000000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3907
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '1000000000000000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3908
    n1 := n1 * 10.
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3909
    n2 := n2 * 10.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3910
    self assert:((n1 * n2) printString = '100000000000000000000000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3911
    self assert:((n1 perform:'*' asSymbol with:n2) printString = '100000000000000000000000000').
41
7b7d7890a939 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  3912
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3913
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3914
     self basicNew testSmallIntegerMultiplication1
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3915
    "
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3916
32
03d8794d981d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 31
diff changeset
  3917
    "Modified: / 9.6.1999 / 17:47:56 / cg"
33
f7b691b71cad checkin from browser
Claus Gittinger <cg@exept.de>
parents: 32
diff changeset
  3918
    "Created: / 9.6.1999 / 17:49:45 / cg"
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3919
!
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3920
35
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3921
testSmallIntegerMultiplication1b
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  3922
    "multiply tests (const * var).
35
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3923
     Notice, the arithmetic tests are both performed via regular sends
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3924
     and via constructed performs. The reason is to test both inlined
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3925
     JIT-compiler code AND the regular methods code."
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3926
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  3927
    |n1 n2|
35
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3928
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3929
    n1 := 100000.
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3930
    n2 := n1 negated.
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3931
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3932
    self assert:((0 * n1) printString = '0').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3933
    self assert:((0 perform:'*' asSymbol with:n1) printString = '0').
35
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3934
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3935
    self assert:((1 * n1) printString = '100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3936
    self assert:((1 perform:'*' asSymbol with:n1) printString = '100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3937
    self assert:((1 * n2) printString = '-100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3938
    self assert:((1 perform:'*' asSymbol with:n2) printString = '-100000').
35
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3939
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3940
    self assert:((-1 * n1) printString = '-100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3941
    self assert:((-1 perform:'*' asSymbol with:n1) printString = '-100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3942
    self assert:((-1 * n2) printString = '100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3943
    self assert:((-1 perform:'*' asSymbol with:n2) printString = '100000').
35
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3944
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3945
    self assert:((2 * n1) printString = '200000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3946
    self assert:((2 perform:'*' asSymbol with:n1) printString = '200000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3947
    self assert:((3 * n1) printString = '300000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3948
    self assert:((3 perform:'*' asSymbol with:n1) printString = '300000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3949
    self assert:((4 * n1) printString = '400000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3950
    self assert:((4 perform:'*' asSymbol with:n1) printString = '400000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3951
    self assert:((5 * n1) printString = '500000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3952
    self assert:((5 perform:'*' asSymbol with:n1) printString = '500000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3953
    self assert:((6 * n1) printString = '600000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3954
    self assert:((6 perform:'*' asSymbol with:n1) printString = '600000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3955
    self assert:((7 * n1) printString = '700000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3956
    self assert:((7 perform:'*' asSymbol with:n1) printString = '700000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3957
    self assert:((8 * n1) printString = '800000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3958
    self assert:((8 perform:'*' asSymbol with:n1) printString = '800000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3959
    self assert:((9 * n1) printString = '900000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3960
    self assert:((9 perform:'*' asSymbol with:n1) printString = '900000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3961
    self assert:((10 * n1) printString = '1000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3962
    self assert:((10 perform:'*' asSymbol with:n1) printString = '1000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3963
    self assert:((11 * n1) printString = '1100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3964
    self assert:((11 perform:'*' asSymbol with:n1) printString = '1100000').
35
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3965
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3966
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3967
     self basicNew testSmallIntegerMultiplication1b
35
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3968
    "
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3969
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3970
    "Modified: / 9.6.1999 / 17:47:56 / cg"
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3971
    "Created: / 9.6.1999 / 17:49:45 / cg"
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3972
!
91703aab73bd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 34
diff changeset
  3973
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3974
testSmallIntegerMultiplication2
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3975
    "multiply tests.
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3976
     Notice, the arithmetic tests are both performed via regular sends
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3977
     and via constructed performs. The reason is to test both inlined
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3978
     JIT-compiler code AND the regular methods code."
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3979
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  3980
    |n1 n2|
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3981
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3982
    n1 := 100000.
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3983
    n2 := n1 negated.
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  3984
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3985
    self assert:((n1 * 2) printString = '200000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3986
    self assert:((n1 perform:'*' asSymbol with:2) printString = '200000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3987
    self assert:((n1 * 3) printString = '300000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3988
    self assert:((n1 perform:'*' asSymbol with:3) printString = '300000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3989
    self assert:((n1 * 4) printString = '400000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3990
    self assert:((n1 perform:'*' asSymbol with:4) printString = '400000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3991
    self assert:((n1 * 5) printString = '500000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3992
    self assert:((n1 perform:'*' asSymbol with:5) printString = '500000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3993
    self assert:((n1 * 6) printString = '600000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3994
    self assert:((n1 perform:'*' asSymbol with:6) printString = '600000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3995
    self assert:((n1 * 7) printString = '700000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3996
    self assert:((n1 perform:'*' asSymbol with:7) printString = '700000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3997
    self assert:((n1 * 8) printString = '800000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3998
    self assert:((n1 perform:'*' asSymbol with:8) printString = '800000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3999
    self assert:((n1 * 9) printString = '900000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4000
    self assert:((n1 perform:'*' asSymbol with:9) printString = '900000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4001
    self assert:((n1 * 10) printString = '1000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4002
    self assert:((n1 perform:'*' asSymbol with:10) printString = '1000000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4003
    self assert:((n1 * 11) printString = '1100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4004
    self assert:((n1 perform:'*' asSymbol with:11) printString = '1100000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4005
    self assert:((n1 * 12) printString = '1200000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4006
    self assert:((n1 perform:'*' asSymbol with:12) printString = '1200000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4007
    self assert:((n1 * 13) printString = '1300000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4008
    self assert:((n1 perform:'*' asSymbol with:13) printString = '1300000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4009
    self assert:((n1 * 14) printString = '1400000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4010
    self assert:((n1 perform:'*' asSymbol with:14) printString = '1400000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4011
    self assert:((n1 * 15) printString = '1500000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4012
    self assert:((n1 perform:'*' asSymbol with:15) printString = '1500000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4013
    self assert:((n1 * 16) printString = '1600000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4014
    self assert:((n1 perform:'*' asSymbol with:16) printString = '1600000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4015
    self assert:((n1 * 17) printString = '1700000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4016
    self assert:((n1 perform:'*' asSymbol with:17) printString = '1700000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4017
    self assert:((n1 * 18) printString = '1800000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4018
    self assert:((n1 perform:'*' asSymbol with:18) printString = '1800000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4019
    self assert:((n1 * 19) printString = '1900000').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4020
    self assert:((n1 perform:'*' asSymbol with:19) printString = '1900000').
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  4021
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  4022
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4023
     self basicNew testSmallIntegerMultiplication2
34
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  4024
    "
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  4025
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  4026
    "Modified: / 9.6.1999 / 17:47:56 / cg"
f52571b86f62 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 33
diff changeset
  4027
    "Created: / 9.6.1999 / 17:49:45 / cg"
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4028
!
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4029
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4030
testSmallIntegerMultiplication3
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4031
    "multiply tests.
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4032
     Notice, the arithmetic tests are both performed via regular sends
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4033
     and via constructed performs. The reason is to test both inlined
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4034
     JIT-compiler code AND the regular methods code."
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4035
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  4036
    |n1 n2|
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4037
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4038
    n1 := 16rFFFF.
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4039
    n2 := n1 negated.
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4040
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4041
    self assert:((n1 * 2) printString = '131070').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4042
    self assert:((n1 perform:'*' asSymbol with:2) printString = '131070').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4043
    self assert:((n2 * 2) printString = '-131070').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4044
    self assert:((n2 perform:'*' asSymbol with:2) printString = '-131070').
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4045
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4046
    n1 := 16rFFFFFF.
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4047
    n2 := n1 negated.
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4048
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4049
    self assert:((n1 * 2) printString = '33554430').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4050
    self assert:((n1 perform:'*' asSymbol with:2) printString = '33554430').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4051
    self assert:((n2 * 2) printString = '-33554430').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4052
    self assert:((n2 perform:'*' asSymbol with:2) printString = '-33554430').
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4053
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4054
    n1 := 16r3FFFFFFF.
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4055
    n2 := n1 negated.
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4056
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4057
    self assert:((n1 * 2) printString = '2147483646').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4058
    self assert:((n1 perform:'*' asSymbol with:2) printString = '2147483646').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4059
    self assert:((n2 * 2) printString = '-2147483646').
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4060
    self assert:((n2 perform:'*' asSymbol with:2) printString = '-2147483646').
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4061
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4062
    SmallInteger maxBytes == 4 ifTrue:[
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  4063
        n1 := 16r3FFFFFFF.
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4064
    ] ifFalse:[
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  4065
        n1 := 16r3FFFFFFFFFFFFFFF.
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4066
    ].
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4067
    self assert:(n1 class == SmallInteger).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4068
    self assert:((n1 * 2) class == LargeInteger).
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4069
    self assert:((n1 perform:'*' asSymbol with:2) class == LargeInteger).
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4070
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4071
    n1 := SmallInteger maxVal // 11.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4072
    self assert:((n1 * 11) class == SmallInteger).
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4073
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4074
    n1 := n1 + 1.
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4075
    self assert:((n1 * 11) class == LargeInteger).
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4076
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4077
    "
103
99b92f745f74 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4078
     self basicNew testSmallIntegerMultiplication3
39
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4079
    "
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4080
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4081
    "Modified: / 9.6.1999 / 17:47:56 / cg"
bed97f34d7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 38
diff changeset
  4082
    "Created: / 9.6.1999 / 17:49:45 / cg"
1523
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4083
!
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4084
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4085
testSmallIntegerNegation
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4086
    "tests boundary conditions at small/large phase change."
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4087
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4088
    |n1 n2 n3|
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4089
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4090
    n1 := 16r3fffffff.
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4091
    n2 := n1 negated.
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4092
    n3 := n2 negated.
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4093
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4094
    self assert:(n1 class == SmallInteger).
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4095
    self assert:(n2 class == SmallInteger).
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4096
    self assert:(n3 == n1).
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4097
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4098
    self assert:(n1 = 16r3FFFFFFF).
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  4099
    self assert:(n2 = 16r-3FFFFFFF).
1523
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4100
    self assert:(n1 == 16r3FFFFFFF).
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  4101
    self assert:(n2 == 16r-3FFFFFFF).
1523
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4102
    self assert:(n1 printString = '1073741823').
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4103
    self assert:(n2 printString = '-1073741823').
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4104
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4105
    "/ ---------------------
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4106
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4107
    n1 := 16rffffffff.
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4108
    n2 := n1 negated.
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4109
    n3 := n2 negated.
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4110
1560
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4111
    SmallInteger maxBytes == 8 ifTrue:[
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4112
        self assert:(n1 class == SmallInteger).
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4113
        self assert:(n2 class == SmallInteger).
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4114
        self assert:(n3 == n1).
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  4115
        self assert:(n2 == 16r-fFFFFFFF).
1560
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4116
        self assert:(n1 == 16rfFFFFFFF).
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4117
    ] ifFalse:[
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4118
        self assert:(n1 class == LargeInteger).
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4119
        self assert:(n2 class == LargeInteger).
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4120
        self assert:(n3 = n1).
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4121
    ].
1523
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4122
    self assert:(n1 = 16rfFFFFFFF).
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  4123
    self assert:(n2 = 16r-fFFFFFFF).
1523
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4124
    self assert:(n1 printString = '4294967295').
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4125
    self assert:(n2 printString = '-4294967295').
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4126
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4127
    "/ ---------------------
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4128
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4129
    n1 := SmallInteger maxVal.
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4130
    n2 := n1 negated.
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4131
    n3 := n2 negated.
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4132
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4133
    self assert:(n1 class == SmallInteger).
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4134
    self assert:(n2 class == SmallInteger).
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4135
    self assert:(n3 == n1).
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4136
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4137
    SmallInteger maxBytes == 4 ifTrue:[
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4138
        self assert:(n1 = 16r3FFFFFFF).
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  4139
        self assert:(n2 = 16r-3FFFFFFF).
1523
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4140
        self assert:(n1 == 16r3FFFFFFF).
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  4141
        self assert:(n2 == 16r-3FFFFFFF).
1523
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4142
        self assert:(n1 printString = '1073741823').
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4143
        self assert:(n2 printString = '-1073741823').
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4144
    ] ifFalse:[
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4145
        self assert:(n1 printString = '4611686018427387903').
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4146
        self assert:(n2 printString = '-4611686018427387903').
1524
851033493e35 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4147
        self assert:(n1 =   16r3FFFFFFFFFFFFFFF).
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  4148
        self assert:(n2 =  16r-3FFFFFFFFFFFFFFF).
1524
851033493e35 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4149
        self assert:(n1 ==  16r3FFFFFFFFFFFFFFF).
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  4150
        self assert:(n2 == 16r-3FFFFFFFFFFFFFFF).
1523
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4151
    ].
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4152
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4153
    "
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4154
     self basicNew testSmallIntegerNegation
f8d51432b498 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
  4155
    "
1560
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4156
d1ef7904a2e8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1529
diff changeset
  4157
    "Modified: / 10-10-2016 / 23:31:11 / cg"
1708
3f1dbabc1632 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 1646
diff changeset
  4158
    "Modified (format): / 19-09-2017 / 16:28:22 / stefan"
2
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4159
! !
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4160
2145
d0df79d7333f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2143
diff changeset
  4161
!IntegerTest methodsFor:'tests-bit fiddling'!
2110
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4162
2246
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4163
testAnyBit
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4164
    self assert:(0 anyBitOfMagnitudeFrom:1 to:1) not.
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4165
    self assert:(1 anyBitOfMagnitudeFrom:1 to:1).
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4166
    self assert:(1 anyBitOfMagnitudeFrom:2 to:2) not.
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4167
    self assert:(1 anyBitOfMagnitudeFrom:1 to:10).
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4168
    self assert:(1 anyBitOfMagnitudeFrom:2 to:10) not.
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4169
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4170
    self assert:(128 anyBitOfMagnitudeFrom:1 to:7) not.
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4171
    self assert:(128 anyBitOfMagnitudeFrom:1 to:8).
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4172
    self assert:(128 anyBitOfMagnitudeFrom:8 to:16).
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4173
    self assert:(128 anyBitOfMagnitudeFrom:1 to:24).
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4174
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4175
    self assert:(256 anyBitOfMagnitudeFrom:1 to:7) not.
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4176
    self assert:(256 anyBitOfMagnitudeFrom:1 to:8) not.
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4177
    self assert:(256 anyBitOfMagnitudeFrom:9 to:9).
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4178
    self assert:(256 anyBitOfMagnitudeFrom:4 to:9).
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4179
    self assert:(256 anyBitOfMagnitudeFrom:9 to:25).
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4180
    self assert:(256 anyBitOfMagnitudeFrom:8 to:16).
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4181
    self assert:(256 anyBitOfMagnitudeFrom:1 to:24).
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4182
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4183
    "Created: / 27-05-2019 / 08:39:19 / Claus Gittinger"
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4184
!
60269925599c #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2201
diff changeset
  4185
2110
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4186
testBitCount
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4187
     #( 16r100000000
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4188
        16r1000000000 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4189
        16r100000000000
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4190
        16r10000000000000
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4191
        16r1000000000000000
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4192
        16r100000000000000000 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4193
        16r10000000000000000000
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4194
        16r1000000000000000000000
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4195
        16r100000000000000000000000
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4196
        16r10000000000000000000000000 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4197
        16r1000000000000000000000000000 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4198
        16r100000000000000000000000000000 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4199
        16r10000000000000000000000000000000 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4200
        16r1000000000000000000000000000000000
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4201
     ) do:[:n |
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4202
         self assert:(n bitCount == 1)
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4203
    ].
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4204
     #( 16rA0A0A0A0A
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4205
        16rA0A0A0A0A0 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4206
        16rA0A0A0A0A0A0
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4207
        16rA0A0A0A0A0A0A0
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4208
        16rA0A0A0A0A0A0A0A0
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4209
        16rA0A0A0A0A0A0A0A0A0 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4210
        16rA0A0A0A0A0A0A0A0A0A0
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4211
        16rA0A0A0A0A0A0A0A0A0A0A0
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4212
        16rA0A0A0A0A0A0A0A0A0A0A0A0
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4213
        16rA0A0A0A0A0A0A0A0A0A0A0A0A0 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4214
        16rA0A0A0A0A0A0A0A0A0A0A0A0A0A0 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4215
        16rA0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4216
        16rA0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0 
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4217
        16rA0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4218
     ) do:[:n |
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4219
         self assert:(n bitCount == ((n hexPrintString occurrencesOf:$A)*2))
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4220
    ].
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4221
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4222
    "Created: / 20-03-2019 / 12:45:37 / Claus Gittinger"
2143
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4223
!
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4224
2264
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4225
testBitInterleaving
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4226
    "check Morton number generation
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4227
     -> https://en.wikipedia.org/wiki/Morton_number_(number_theory))"
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4228
     
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4229
                                                "/       0 0 1 1                
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4230
                                                "/      1 0 1 0                
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4231
     self assert:(2r0011 bitInterleaveWith:2r1010) == 2r10001101.
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4232
     self assert:(2r10001101 bitDeinterleave:2) = #(2r0011 2r1010).
2428
fee50b3ccfa8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  4233
     self assert:(2r00110011 bitInterleaveWith:2r10101010) == 2r1000110110001101.
fee50b3ccfa8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  4234
     self assert:(2r0011001100110011 bitInterleaveWith:2r1010101010101010) = 2r10001101100011011000110110001101.
2264
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4235
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4236
                                                "/                   0  0  1  1                
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4237
                                                "/                  1  0  1  0                
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4238
                                                "/                 1  1  0  1                
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4239
     self assert:(2r0011 bitInterleaveWith:2r1010 and:2r1101) == 2r110100011101.
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4240
     self assert:(2r110100011101 bitDeinterleave:3) = #(2r0011 2r1010 2r1101).
2428
fee50b3ccfa8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  4241
     self assert:(2r00110011 bitInterleaveWith:2r10101010 and:2r11011101) == 2r110100011101110100011101.
fee50b3ccfa8 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2397
diff changeset
  4242
     self assert:(2r0011001100110011 bitInterleaveWith:2r1010101010101010 and:2r1101110111011101) = 2r110100011101110100011101110100011101110100011101.
2264
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4243
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4244
    "Created: / 04-06-2019 / 01:16:09 / Claus Gittinger"
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4245
!
3e8bba774202 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
  4246
2143
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4247
testBitReversed
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4248
    #( 
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4249
        2r10000000 2r00000001
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4250
        2r01000000 2r00000010
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4251
        2r00100000 2r00000100
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4252
        2r00010000 2r00001000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4253
        2r00001000 2r00010000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4254
        2r00000100 2r00100000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4255
        2r00000010 2r01000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4256
        2r00000001 2r10000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4257
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4258
        "/ high bits are to be ignored (i.e. clear) 
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4259
        2r100000001 2r10000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4260
        2r110000000 2r00000001
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4261
    )
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4262
    pairWiseDo:[:in :expected |
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4263
        self assert:(in bitReversed8 == expected)
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4264
    ].
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4265
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4266
    #( 
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4267
        2r1000000000000000 2r0000000000000001
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4268
        2r0100000000000000 2r0000000000000010
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4269
        2r0010000000000000 2r0000000000000100
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4270
        2r0001000000000000 2r0000000000001000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4271
        2r0000100000000000 2r0000000000010000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4272
        2r0000010000000000 2r0000000000100000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4273
        2r0000001000000000 2r0000000001000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4274
        2r0000000100000000 2r0000000010000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4275
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4276
        2r0000000010000000 2r0000000100000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4277
        2r0000000001000000 2r0000001000000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4278
        2r0000000000100000 2r0000010000000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4279
        2r0000000000010000 2r0000100000000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4280
        2r0000000000001000 2r0001000000000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4281
        2r0000000000000100 2r0010000000000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4282
        2r0000000000000010 2r0100000000000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4283
        2r0000000000000001 2r1000000000000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4284
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4285
        "/ high bits are to be ignored (i.e. clear) 
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4286
        2r10000000000000001 2r1000000000000000
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4287
        2r11000000000000000 2r0000000000000001
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4288
    )
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4289
    pairWiseDo:[:in :expected |
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4290
        self assert:(in bitReversed16 == expected)
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4291
    ].
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4292
2191
bdd8c7dd8ffe #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 2189
diff changeset
  4293
    0 to:64 do:[:n |
2189
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4294
        |nr|
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4295
        
2191
bdd8c7dd8ffe #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 2189
diff changeset
  4296
        nr := 1 bitShift:n.
2189
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4297
        n < 16 ifTrue:[
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4298
            self assert:((nr bitReversed16) bitReversed16) = nr.
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4299
        ].    
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4300
        n < 32 ifTrue:[
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4301
            self assert:((nr bitReversed32) bitReversed32) = nr.
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4302
        ].    
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4303
        n < 64 ifTrue:[
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4304
            self assert:((nr bitReversed64) bitReversed64) = nr.
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4305
        ].    
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4306
    ].
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4307
    
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4308
    #(
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4309
      16r12345678 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4310
      16r23456781 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4311
      16r34567812 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4312
      16r45678123 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4313
      16r56781234 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4314
      16r67812345 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4315
      16r78123456 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4316
      16r81234567 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4317
    ) do:[:each |
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4318
        |s1 s2 s1Padded s2Padded|
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4319
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4320
        s1 := each printStringRadix:2.
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4321
        s2 := each bitReversed32 printStringRadix:2.
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4322
        s1Padded := s1 leftPaddedTo:32 with:$0.
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4323
        s2Padded := s2 leftPaddedTo:32 with:$0.
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4324
        self assert:(s1Padded = s2Padded reversed).
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4325
    ].
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4326
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4327
    #(
2201
f5fa86b51075 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2191
diff changeset
  4328
      16r0123456789ABCDEF 
2189
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4329
      16r123456789ABCDEF0 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4330
      16r23456789ABCDEF01 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4331
      16r3456789ABCDEF012 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4332
      16r456789ABCDEF0123 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4333
      16r56789ABCDEF01234 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4334
      16r6789ABCDEF012345 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4335
      16r789ABCDEF0123456 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4336
      16r89ABCDEF01234567 
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4337
    ) do:[:each |
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4338
        |s1 s2 s1Padded s2Padded|
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4339
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4340
        s1 := each printStringRadix:2.
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4341
        s2 := each bitReversed64 printStringRadix:2.
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4342
        s1Padded := s1 leftPaddedTo:64 with:$0.
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4343
        s2Padded := s2 leftPaddedTo:64 with:$0.
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4344
        self assert:(s1Padded = s2Padded reversed).
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4345
    ].
5c1b6dc15541 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 2145
diff changeset
  4346
2143
001d5721b6ec #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2110
diff changeset
  4347
    "Created: / 24-03-2019 / 11:36:18 / Claus Gittinger"
2191
bdd8c7dd8ffe #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 2189
diff changeset
  4348
    "Modified: / 27-03-2019 / 15:16:43 / stefan"
2201
f5fa86b51075 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2191
diff changeset
  4349
    "Modified: / 28-03-2019 / 16:59:52 / Claus Gittinger"
2263
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4350
!
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4351
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4352
testBitShift
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4353
    self assert:(1 bitShift:1) = 2.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4354
    self assert:(-1 bitShift:1) = -2.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4355
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4356
    self assert:(1 bitShift:7) = 128.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4357
    self assert:(-1 bitShift:7) = -128.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4358
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4359
    self assert:(1 bitShift:8) = 16r100.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4360
    self assert:(-1 bitShift:8) = 16r-100.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4361
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4362
    self assert:(1 bitShift:16) = 16r10000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4363
    self assert:(-1 bitShift:16) = 16r-10000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4364
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4365
    self assert:(1 bitShift:24) = 16r1000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4366
    self assert:(-1 bitShift:24) = 16r-1000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4367
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4368
    "/ the following are out of the smallInteger range on 32bit systems
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4369
    self assert:(1 bitShift:30) = 16r40000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4370
    self assert:(-1 bitShift:30) = 16r-40000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4371
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4372
    self assert:(1 bitShift:31) = 16r80000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4373
    self assert:(-1 bitShift:31) = 16r-80000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4374
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4375
    self assert:(1 bitShift:32) = 16r100000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4376
    self assert:(-1 bitShift:32) = 16r-100000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4377
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4378
    self assert:(1 bitShift:40) = 16r10000000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4379
    self assert:(-1 bitShift:40) = 16r-10000000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4380
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4381
    self assert:(1 bitShift:56) = 16r100000000000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4382
    self assert:(-1 bitShift:56) = 16r-100000000000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4383
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4384
    "/ the following are out of the smallInteger range on 32bit systems
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4385
    self assert:(1 bitShift:62) = 16r4000000000000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4386
    self assert:(-1 bitShift:62) = 16r-4000000000000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4387
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4388
    self assert:(1 bitShift:63) = 16r8000000000000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4389
    self assert:(-1 bitShift:63) = 16r-8000000000000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4390
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4391
    self assert:(1 bitShift:64) = 16r10000000000000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4392
    self assert:(-1 bitShift:64) = 16r-10000000000000000.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4393
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4394
    "Created: / 04-06-2019 / 00:58:47 / Claus Gittinger"
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4395
!
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4396
2395
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4397
testByteSwap
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4398
    "/ <testedMethods: #( (Integer >> #byteSwapped32) (Integer >> #byteSwapped64)) >
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4399
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4400
    self assert:(16r1122 byteSwapped16) = 16r2211.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4401
    self assert:(16r2211 byteSwapped16) = 16r1122.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4402
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4403
    self assert:(16r11223344 byteSwapped32) = 16r44332211.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4404
    self assert:(16r44332211 byteSwapped32) = 16r11223344.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4405
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4406
    self assert:(16r11223344 byteSwapped64) = 16r4433221100000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4407
    self assert:(16r44332211 byteSwapped64) = 16r1122334400000000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4408
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4409
    self assert:(16r8877665544332211 byteSwapped64) = 16r1122334455667788.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4410
    self assert:(16r1122334455667788 byteSwapped64) = 16r8877665544332211.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4411
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4412
    "/ higher bits are ignored!!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4413
    self assert:(16r33441122 byteSwapped16) = 16r2211.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4414
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4415
    self assert:(16r9911223344 byteSwapped32) = 16r44332211.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4416
    self assert:(16r8877665544332211 byteSwapped32) = 16r11223344.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4417
    self assert:(16r998877665544332211 byteSwapped64) = 16r1122334455667788.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4418
    self assert:(16r991122334455667788 byteSwapped64) = 16r8877665544332211.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4419
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4420
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4421
     self basicNew testByteSwap
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4422
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4423
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4424
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4425
testHighBitLowBit
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4426
    self assert:( 2r0 highBit == 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4427
    self assert:( 2r1 highBit == 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4428
    self assert:( 2r10 highBit == 2).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4429
    self assert:( 2r100 highBit == 3).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4430
    self assert:( 2r1000 highBit == 4).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4431
    self assert:( 16r10 highBit == 5).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4432
    self assert:( 16r100 highBit == 9).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4433
    self assert:( 16r1000 highBit == 13).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4434
    self assert:( 16r10000 highBit == 17).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4435
    self assert:( 16r100000 highBit == 21).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4436
    self assert:( 16r1000000 highBit == 25).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4437
    self assert:( 16r10000000 highBit == 29).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4438
    self assert:( 16r20000000 highBit == 30).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4439
    self assert:( 16r3FFFFFFF highBit == 30).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4440
    self assert:( 16r40000000 highBit == 31).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4441
    self assert:( 16r7FFFFFFF highBit == 31).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4442
    self assert:( 16r80000000 highBit == 32).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4443
    self assert:( 16rFFFFFFFF highBit == 32).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4444
    self assert:( 16r100000000 highBit == 33).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4445
    self assert:( 16r1FFFFFFFF highBit == 33).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4446
    self assert:( 16r100000001 highBit == 33).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4447
    self assert:( 16r1000000000 highBit == 37).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4448
    self assert:( 16r10000000000 highBit == 41).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4449
    self assert:( 16r100000000000 highBit == 45).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4450
    self assert:( 16r1000000000000 highBit == 49).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4451
    self assert:( 16r1FFFFFFFFFFFF highBit == 49).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4452
    self assert:( 16r2000000000000 highBit == 50).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4453
    self assert:( 16r4000000000000 highBit == 51).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4454
    self assert:( 16r7FFFFFFFFFFFF highBit == 51).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4455
    self assert:( 16r8000000000000 highBit == 52).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4456
    self assert:( 16rFFFFFFFFFFFFF highBit == 52).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4457
    self assert:( 16r10000000000000 highBit == 53).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4458
    self assert:( 16r1FFFFFFFFFFFFF highBit == 53).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4459
    self assert:( 16r20000000000000 highBit == 54).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4460
    self assert:( 16r3FFFFFFFFFFFFF highBit == 54).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4461
    self assert:( 16r40000000000000 highBit == 55).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4462
    self assert:( 16r5FFFFFFFFFFFFF highBit == 55).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4463
    self assert:( 16r7FFFFFFFFFFFFF highBit == 55).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4464
    self assert:( 16r80000000000000 highBit == 56).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4465
    self assert:( 16r100000000000000 highBit == 57).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4466
    self assert:( 16r1000000000000000 highBit == 61).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4467
    self assert:( 16r1FFFFFFFFFFFFFFF highBit == 61).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4468
    self assert:( 16r2000000000000000 highBit == 62).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4469
    self assert:( 16r3FFFFFFFFFFFFFFF highBit == 62).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4470
    self assert:( 16r4000000000000000 highBit == 63).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4471
    self assert:( 16r7FFFFFFFFFFFFFFF highBit == 63).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4472
    self assert:( 16r8000000000000000 highBit == 64).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4473
    self assert:( 16rFFFFFFFFFFFFFFFF highBit == 64).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4474
    self assert:( 16r10000000000000000 highBit == 65).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4475
    self assert:( 16r1FFFFFFFFFFFFFFFF highBit == 65).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4476
    self assert:( (1 bitShift:1000) highBit == 1001).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4477
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4478
    self assert:( 2r0 lowBit == 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4479
    self assert:( 2r1 lowBit == 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4480
    self assert:( 2r10 lowBit == 2).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4481
    self assert:( 2r100 lowBit == 3).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4482
    self assert:( 2r1000 lowBit == 4).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4483
    self assert:( 16r10 lowBit == 5).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4484
    self assert:( 16r100 lowBit == 9).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4485
    self assert:( 16r1000 lowBit == 13).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4486
    self assert:( 16r10000 lowBit == 17).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4487
    self assert:( 16r100000 lowBit == 21).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4488
    self assert:( 16r1000000 lowBit == 25).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4489
    self assert:( 16r10000000 lowBit == 29).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4490
    self assert:( 16r100000000 lowBit == 33).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4491
    self assert:( 16r1000000000 lowBit == 37).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4492
    self assert:( 16r10000000000 lowBit == 41).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4493
    self assert:( 16r100000000000 lowBit == 45).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4494
    self assert:( 16r1000000000000 lowBit == 49).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4495
    self assert:( 16r10000000000000 lowBit == 53).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4496
    self assert:( 16r100000000000000 lowBit == 57).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4497
    self assert:( 16r1000000000000000 lowBit == 61).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4498
    self assert:( 16r10000000000000000 lowBit == 65).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4499
    self assert:( (1 bitShift:1000) lowBit == 1001).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4500
    
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4501
    self assert:(( 2r1 bitOr: 16r10000000000) lowBit = 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4502
    self assert:(( 2r10 bitOr: 16r10000000000) lowBit = 2).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4503
    self assert:(( 2r100 bitOr: 16r10000000000) lowBit = 3).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4504
    self assert:(( 2r1000 bitOr: 16r10000000000) lowBit = 4).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4505
    self assert:(( 16r10 bitOr: 16r10000000000) lowBit = 5).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4506
    self assert:(( 16r100 bitOr: 16r10000000000) lowBit = 9).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4507
    self assert:(( 16r1000 bitOr: 16r10000000000) lowBit = 13).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4508
    self assert:(( 16r10000 bitOr: 16r10000000000) lowBit = 17).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4509
    self assert:(( 16r100000 bitOr: 16r10000000000) lowBit = 21).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4510
    self assert:(( 16r1000000 bitOr: 16r10000000000) lowBit = 25).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4511
    self assert:(( 16r10000000 bitOr: 16r10000000000) lowBit = 29).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4512
    self assert:(( 16r100000000 bitOr: 16r10000000000) lowBit = 33).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4513
    self assert:(( 16r1000000000 bitOr: 16r10000000000) lowBit = 37).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4514
    self assert:(( 16r10000000000 bitOr: 16r10000000000) lowBit = 41).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4515
    self assert:(( 16r100000000000 bitOr: 16r100000000000) lowBit = 45).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4516
    self assert:(( 16r1000000000000 bitOr: 16r1000000000000) lowBit = 49).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4517
    self assert:(( 16r10000000000000 bitOr: 16r10000000000000) lowBit = 53).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4518
    self assert:(( 16r100000000000000 bitOr: 16r100000000000000) lowBit = 57).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4519
    self assert:(( 16r1000000000000000 bitOr: 16r1000000000000000) lowBit = 61).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4520
    self assert:(( 16r10000000000000000 bitOr: 16r10000000000000000) lowBit = 65).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4521
    self assert:(( (1 bitShift:1000) bitOr: (1 bitShift:1001)) lowBit = 1001).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4522
2455
594c867063b7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2428
diff changeset
  4523
    self assert:2r00101000 lowBit == 4.
594c867063b7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2428
diff changeset
  4524
    "/ self assert:2r-00101000 lowBit == 4.  -- not really
594c867063b7 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2428
diff changeset
  4525
2395
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4526
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4527
     self basicNew testHighBitLowBit
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4528
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4529
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4530
    "Modified: / 05-07-2017 / 16:00:51 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4531
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4532
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4533
testIntegerShifts
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4534
    "arithmetic tests.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4535
     Notice, the arithmetic tests are both performed via regular sends
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4536
     and via constructed performs. The reason is to test both inlined
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4537
     JIT-compiler code AND the regular methods code."
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4538
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4539
    self testIntegerShifts1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4540
    self testIntegerShifts2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4541
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4542
    self assert:(
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4543
     (((0 to:64) collect:[:s | 1 bitShift:s])
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4544
	collect:[:n | n highBit]) = (1 to:65)
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4545
    ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4546
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4547
    1 to:10000 do:[:s |
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4548
	self assert:( (1 bitShift:s) highBit == (s+1) )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4549
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4550
    1 to:10000 do:[:s |
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4551
	self assert:( ((1 bitShift:s) - 1) highBit == s )
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4552
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4553
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4554
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4555
     self basicNew testIntegerShifts
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4556
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4557
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4558
    "Created: / 6.6.1999 / 14:47:51 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4559
    "Modified: / 9.6.1999 / 17:49:57 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4560
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4561
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4562
testIntegerShifts1
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4563
    "arithmetic tests.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4564
     Notice, the arithmetic tests are both performed via regular sends
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4565
     and via constructed performs. The reason is to test both inlined
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4566
     JIT-compiler code AND the regular methods code."
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4567
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4568
    |n1 n2 s|
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4569
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4570
    n1 := 100000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4571
    n2 := n1 negated.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4572
    s := 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4573
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4574
    self assert:(n1 printString = '100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4575
    self assert:(n2 printString = '-100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4576
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4577
    self assert:((n1 bitShift:s) printString = '200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4578
    self assert:((n1 bitShift:1) printString = '200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4579
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4580
    self assert:((n1 perform:'bitShift:' asSymbol with:1) printString = '200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4581
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4582
    s := s + 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4583
    self assert:((n1 bitShift:s) printString = '400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4584
    self assert:((n1 bitShift:2) printString = '400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4585
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4586
    self assert:((n1 perform:'bitShift:' asSymbol with:2) printString = '400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4587
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4588
    s := s + 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4589
    self assert:((n1 bitShift:s) printString = '800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4590
    self assert:((n1 bitShift:3) printString = '800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4591
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4592
    self assert:((n1 perform:'bitShift:' asSymbol with:3) printString = '800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4593
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4594
    s := s + 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4595
    self assert:((n1 bitShift:s) printString = '1600000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4596
    self assert:((n1 bitShift:4) printString = '1600000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4597
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '1600000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4598
    self assert:((n1 perform:'bitShift:' asSymbol with:4) printString = '1600000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4599
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4600
    s := s + 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4601
    self assert:((n1 bitShift:s) printString = '3200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4602
    self assert:((n1 bitShift:5) printString = '3200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4603
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '3200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4604
    self assert:((n1 perform:'bitShift:' asSymbol with:5) printString = '3200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4605
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4606
    s := s + 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4607
    self assert:((n1 bitShift:s) printString = '6400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4608
    self assert:((n1 bitShift:6) printString = '6400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4609
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '6400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4610
    self assert:((n1 perform:'bitShift:' asSymbol with:6) printString = '6400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4611
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4612
    s := s + 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4613
    self assert:((n1 bitShift:s) printString = '12800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4614
    self assert:((n1 bitShift:7) printString = '12800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4615
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '12800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4616
    self assert:((n1 perform:'bitShift:' asSymbol with:7) printString = '12800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4617
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4618
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4619
     self basicNew testIntegerShifts1
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4620
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4621
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4622
    "Created: / 6.6.1999 / 14:47:51 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4623
    "Modified: / 9.6.1999 / 17:49:57 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4624
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4625
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4626
testIntegerShifts2
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4627
    "arithmetic tests.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4628
     Notice, the arithmetic tests are both performed via regular sends
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4629
     and via constructed performs. The reason is to test both inlined
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4630
     JIT-compiler code AND the regular methods code."
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4631
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4632
    |n1 s|
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4633
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4634
    n1 := 12800000.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4635
    s := -1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4636
    self assert:((n1 bitShift:s) printString = '6400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4637
    self assert:((n1 bitShift:-1) printString = '6400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4638
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '6400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4639
    self assert:((n1 perform:'bitShift:' asSymbol with:-1) printString = '6400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4640
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4641
    s := s - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4642
    self assert:((n1 bitShift:s) printString = '3200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4643
    self assert:((n1 bitShift:-2) printString = '3200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4644
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '3200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4645
    self assert:((n1 perform:'bitShift:' asSymbol with:-2) printString = '3200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4646
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4647
    s := s - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4648
    self assert:((n1 bitShift:s) printString = '1600000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4649
    self assert:((n1 bitShift:-3) printString = '1600000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4650
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '1600000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4651
    self assert:((n1 perform:'bitShift:' asSymbol with:-3) printString = '1600000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4652
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4653
    s := s - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4654
    self assert:((n1 bitShift:s) printString = '800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4655
    self assert:((n1 bitShift:-4) printString = '800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4656
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4657
    self assert:((n1 perform:'bitShift:' asSymbol with:-4) printString = '800000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4658
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4659
    s := s - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4660
    self assert:((n1 bitShift:s) printString = '400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4661
    self assert:((n1 bitShift:-5) printString = '400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4662
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4663
    self assert:((n1 perform:'bitShift:' asSymbol with:-5) printString = '400000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4664
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4665
    s := s - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4666
    self assert:((n1 bitShift:s) printString = '200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4667
    self assert:((n1 bitShift:-6) printString = '200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4668
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4669
    self assert:((n1 perform:'bitShift:' asSymbol with:-6) printString = '200000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4670
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4671
    s := s - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4672
    self assert:((n1 bitShift:s) printString = '100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4673
    self assert:((n1 bitShift:-7) printString = '100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4674
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4675
    self assert:((n1 perform:'bitShift:' asSymbol with:-7) printString = '100000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4676
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4677
    s := s - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4678
    self assert:((n1 bitShift:s) printString = '50000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4679
    self assert:((n1 bitShift:-8) printString = '50000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4680
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '50000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4681
    self assert:((n1 perform:'bitShift:' asSymbol with:-8) printString = '50000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4682
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4683
    s := s - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4684
    self assert:((n1 bitShift:s) printString = '25000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4685
    self assert:((n1 bitShift:-9) printString = '25000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4686
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '25000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4687
    self assert:((n1 perform:'bitShift:' asSymbol with:-9) printString = '25000').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4688
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4689
    s := s - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4690
    self assert:((n1 bitShift:s) printString = '12500').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4691
    self assert:((n1 bitShift:-10) printString = '12500').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4692
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '12500').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4693
    self assert:((n1 perform:'bitShift:' asSymbol with:-10) printString = '12500').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4694
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4695
    s := s - 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4696
    self assert:((n1 bitShift:s) printString = '6250').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4697
    self assert:((n1 bitShift:-11) printString = '6250').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4698
    self assert:((n1 perform:'bitShift:' asSymbol with:s) printString = '6250').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4699
    self assert:((n1 perform:'bitShift:' asSymbol with:-11) printString = '6250').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4700
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4701
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4702
     self basicNew testIntegerShifts2
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4703
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4704
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4705
    "Created: / 6.6.1999 / 14:47:51 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4706
    "Modified: / 9.6.1999 / 17:49:57 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4707
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4708
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4709
testIntegerShifts3
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4710
    "arithmetic tests.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4711
     Notice, the arithmetic tests are both performed via regular sends
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4712
     and via constructed performs. The reason is to test both inlined
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4713
     JIT-compiler code AND the regular methods code."
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4714
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4715
    self assert:( self doConstantIntegerShift == 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4716
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4717
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4718
     self basicNew testIntegerShifts3
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4719
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4720
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4721
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4722
testIntegerShifts4
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4723
    "arithmetic tests.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4724
     Notice, the arithmetic tests are both performed via regular sends
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4725
     and via constructed performs. The reason is to test both inlined
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4726
     JIT-compiler code AND the regular methods code."
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4727
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4728
    |a|
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4729
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4730
    a := 16r1234.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4731
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4732
    self assert:( ((a bitShift:-4) bitAnd:16rFF) == 16r23 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4733
    self assert:( ((a bitShift:-8) bitAnd:16rFF) == 16r12 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4734
    self assert:( ((a bitShift:-12) bitAnd:16rFF) == 16r1 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4735
    self assert:( ((a bitShift:-16) bitAnd:16rFF) == 0 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4736
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4737
    "/ should not shift in any sign bits ...
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4738
    a := 16r1FFFFFFF.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4739
    self assert:( (a bitShift:-4) == 16r1FFFFFF ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4740
    a := 16r3FFFFFFF.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4741
    self assert:( (a bitShift:-4) == 16r3FFFFFF ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4742
    a := 16r7FFFFFFF.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4743
    self assert:( (a bitShift:-4) == 16r7FFFFFF ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4744
    a := 16rFFFFFFFF.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4745
    self assert:( (a bitShift:-4) == 16rFFFFFFF ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4746
    a := 16r1FFFFFFFF.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4747
    self assert:( (a bitShift:-4) == 16r1FFFFFFF ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4748
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4749
    a := 16r1FFFFFFF.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4750
    self assert:( (a bitShift:-8) == 16r1FFFFF ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4751
    a := 16r3FFFFFFF.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4752
    self assert:( (a bitShift:-8) == 16r3FFFFF ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4753
    a := 16r7FFFFFFF.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4754
    self assert:( (a bitShift:-8) == 16r7FFFFF ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4755
    a := 16rFFFFFFFF.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4756
    self assert:( (a bitShift:-8) == 16rFFFFFF ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4757
    a := 16r1FFFFFFFF.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4758
    self assert:( (a bitShift:-8) == 16r1FFFFFF ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4759
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4760
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4761
     self basicNew testIntegerShifts4
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4762
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4763
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4764
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4765
testLargeBitOperations
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4766
    "large bit operations test."
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4767
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4768
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFF) hexPrintString = '2211'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4769
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFFFF) hexPrintString  = '332211'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4770
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFFFFFF) hexPrintString = '44332211'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4771
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFFFFFFFF) hexPrintString = '5544332211'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4772
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFFFFFFFFFF) hexPrintString = '665544332211'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4773
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFFFFFFFFFFFF) hexPrintString = '77665544332211'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4774
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFFFFFFFFFFFFFF) hexPrintString = '8877665544332211'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4775
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFFFFFFFFFFFFFFFF) hexPrintString = '998877665544332211'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4776
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFFFFFFFFFFFFFFFFFF) hexPrintString = 'AA998877665544332211'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4777
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFFFFFFFFFFFFFFFFFFFF) hexPrintString = 'BBAA998877665544332211'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4778
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFFFFFFFFFFFFFFFFFFFFFF) hexPrintString = 'CCBBAA998877665544332211'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4779
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4780
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFF) hexPrintString = 'FFEEDDCCBBAA99887766554433FFFF'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4781
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFFFF) hexPrintString  = 'FFEEDDCCBBAA998877665544FFFFFF'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4782
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFFFFFF) hexPrintString = 'FFEEDDCCBBAA9988776655FFFFFFFF'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4783
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFFFFFFFF) hexPrintString = 'FFEEDDCCBBAA99887766FFFFFFFFFF'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4784
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFFFFFFFFFF) hexPrintString = 'FFEEDDCCBBAA998877FFFFFFFFFFFF'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4785
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFFFFFFFFFFFF) hexPrintString = 'FFEEDDCCBBAA9988FFFFFFFFFFFFFF'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4786
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFFFFFFFFFFFFFF) hexPrintString = 'FFEEDDCCBBAA99FFFFFFFFFFFFFFFF'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4787
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFFFFFFFFFFFFFFFF) hexPrintString = 'FFEEDDCCBBAAFFFFFFFFFFFFFFFFFF'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4788
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFFFFFFFFFFFFFFFFFF) hexPrintString = 'FFEEDDCCBBFFFFFFFFFFFFFFFFFFFF'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4789
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFFFFFFFFFFFFFFFFFFFF) hexPrintString = 'FFEEDDCCFFFFFFFFFFFFFFFFFFFFFF'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4790
     self assert:(16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFFFFFFFFFFFFFFFFFFFFFF) hexPrintString = 'FFEEDDFFFFFFFFFFFFFFFFFFFFFFFF'.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4791
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4792
    Time millisecondsToRun:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4793
        1000000 timesRepeat:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4794
            (16rFFEEDDCCBBAA998877665544332211 bitAnd:16rFFFFFFFFFFFFFFFFFFFFFFFF)
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4795
        ]
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4796
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4797
    "/ bitAnd inherited via Integer:  1638 1575 1576
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4798
    "/ bitAnd tuned in largeInteger:  172 171 172
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4799
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4800
    Time millisecondsToRun:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4801
        1000000 timesRepeat:[
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4802
            (16rFFEEDDCCBBAA998877665544332211 bitOr:16rFFFFFFFFFFFFFFFFFFFFFFFF)
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4803
        ]
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4804
    ].
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4805
    "/ bitOr inherited via Integer:  1903 1856 1856
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4806
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4807
    self assert:( 16r800008 signExtendedFromBit:4 ) = -8. 
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4808
    self assert:( 16r7FFF07 signExtendedFromBit:4 ) = 7.     
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4809
    self assert:( 16r7FFF0F signExtendedFromBit:4 ) = -1.    
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4810
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4811
    self assert:( 16rFFFFFF signExtendedFromBit:8 ) = -1.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4812
    self assert:( 16rFFFF7F signExtendedFromBit:8 ) = 16r7F.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4813
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4814
    self assert:( 16rFFFFFF signExtendedByteValue ) = -1.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4815
    self assert:( 16rFFFF7F signExtendedByteValue ) = 16r7F.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4816
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4817
    self assert:( 16rFFFF signExtendedShortValue ) = -1.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4818
    self assert:( 16r7FFF signExtendedShortValue ) = 16r7FFF.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4819
    self assert:( 16rFFFFFFFF signExtendedShortValue ) = -1.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4820
    self assert:( 16rFFFF7FFF signExtendedShortValue ) = 16r7FFF.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4821
    self assert:( 16rFFFFFFFFFF signExtendedShortValue ) = -1.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4822
    self assert:( 16rFFFFFF7FFF signExtendedShortValue ) = 16r7FFF.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4823
    self assert:( 16rFFFFFFFFFFFF signExtendedShortValue ) = -1.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4824
    self assert:( 16rFFFFFFFF7FFF signExtendedShortValue ) = 16r7FFF.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4825
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4826
    self assert:( 16rFFFFFFFF signExtendedLongValue ) = -1.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4827
    self assert:( 16r7FFFFFFF signExtendedLongValue ) = 2147483647.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4828
    self assert:( 16r80000000 signExtendedLongValue ) = -2147483648.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4829
    self assert:( 16rFFFFFFFFFFFF signExtendedLongValue ) = -1.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4830
    self assert:( 16rFFFF7FFFFFFF signExtendedLongValue ) = 2147483647.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4831
    self assert:( 16rFFFF80000000 signExtendedLongValue ) = -2147483648.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4832
    self assert:( 16rFFFFFFFFFFFFFFFF signExtendedLongValue ) = -1.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4833
    self assert:( 16rFFFFFFFF7FFFFFFF signExtendedLongValue ) = 2147483647.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4834
    self assert:( 16rFFFFFFFF80000000 signExtendedLongValue ) = -2147483648.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4835
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4836
    self assert:( 16rFFFFFFFFFFFFFFFF signExtendedLongLongValue ) = -1.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4837
    self assert:( 16r7FFFFFFFFFFFFFFF signExtendedLongLongValue ) = 16r7FFFFFFFFFFFFFFF.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4838
    self assert:( 16rFFFFFFFFFFFFFFFFFFFF signExtendedLongLongValue ) = -1.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4839
    self assert:( 16rFFFF7FFFFFFFFFFFFFFF signExtendedLongLongValue ) = 16r7FFFFFFFFFFFFFFF.   
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4840
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4841
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4842
     self basicNew testLargeBitOperations
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4843
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4844
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4845
    "Modified: / 26-02-2016 / 19:47:25 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4846
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4847
2263
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4848
testRightShift
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4849
    "right shifts must preserve the sign - even for large integers"
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4850
    
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4851
    #(1 7 8 16 24 
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4852
      30 31 32 33
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4853
      40 48 56
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4854
      62 63 64
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4855
      65
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4856
      126 127 128
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4857
      1000 2000
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4858
    ) do:[:cnt |
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4859
        self assert:((1 bitShift:cnt) bitShift:cnt negated) = 1.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4860
        self assert:((-1 bitShift:cnt) bitShift:cnt negated) = -1.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4861
    ].
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4862
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4863
    "Created: / 04-06-2019 / 01:05:30 / Claus Gittinger"
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4864
!
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4865
2395
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4866
testSignExtension
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4867
    "/ 8bit
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4868
    self assert:( 16r80 signExtendedByteValue = -128 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4869
    self assert:( 16r7F signExtendedByteValue = 127 ).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4870
    self assert:( 16rFF signExtendedByteValue = -1 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4871
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4872
    "/ higher bits are ignored
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4873
    self assert:( 16rF80 signExtendedByteValue = -128 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4874
    self assert:( 16rF7F signExtendedByteValue = 127 ).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4875
    self assert:( 16rFFF signExtendedByteValue = -1 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4876
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4877
    "/ 16bit
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4878
    self assert:( 16r8000 signExtendedShortValue = -32768 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4879
    self assert:( 16r7FFF signExtendedShortValue = 32767 ).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4880
    self assert:( 16rFFFF signExtendedShortValue = -1 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4881
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4882
    "/ higher bits are ignored
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4883
    self assert:( 16rF8000 signExtendedShortValue = -32768 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4884
    self assert:( 16rF7FFF signExtendedShortValue = 32767 ).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4885
    self assert:( 16rFFFFF signExtendedShortValue = -1 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4886
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4887
    "/ 24bit
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4888
    self assert:( 16r800000 signExtended24BitValue = -8388608 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4889
    self assert:( 16r7FFFFF signExtended24BitValue = 8388607 ).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4890
    self assert:( 16rFFFFFF signExtended24BitValue = -1 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4891
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4892
    "/ higher bits are ignored
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4893
    self assert:( 16rF800000 signExtended24BitValue = -8388608 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4894
    self assert:( 16rF7FFFFF signExtended24BitValue = 8388607 ).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4895
    self assert:( 16rFFFFFFF signExtended24BitValue = -1 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4896
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4897
    "/ 32bit
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4898
    self assert:( 16r80000000 signExtendedLongValue = -2147483648 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4899
    self assert:( 16r7FFFFFFF signExtendedLongValue = 2147483647 ).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4900
    self assert:( 16rFFFFFFFF signExtendedLongValue = -1 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4901
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4902
    "/ higher bits are ignored
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4903
    self assert:( 16rF80000000 signExtendedLongValue = -2147483648 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4904
    self assert:( 16rF7FFFFFFF signExtendedLongValue = 2147483647 ).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4905
    self assert:( 16rFFFFFFFFF signExtendedLongValue = -1 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4906
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4907
    "/ 64bit
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4908
    self assert:( 16r8000000000000000 signExtendedLongLongValue = -9223372036854775808 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4909
    self assert:( 16r7FFFFFFFFFFFFFFF signExtendedLongLongValue = 9223372036854775807 ).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4910
    self assert:( 16rFFFFFFFFFFFFFFFF signExtendedLongLongValue = -1 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4911
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4912
    "/ higher bits are ignored
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4913
    self assert:( 16rF8000000000000000 signExtendedLongLongValue = -9223372036854775808 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4914
    self assert:( 16rF7FFFFFFFFFFFFFFF signExtendedLongLongValue = 9223372036854775807 ).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4915
    self assert:( 16rFFFFFFFFFFFFFFFFF signExtendedLongLongValue = -1 ).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4916
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4917
    "/ arbitrary nr of bits
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4918
    self assert:( 2r1000 signExtendedFromBit:4) = -8 .
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4919
    self assert:( 2r0111 signExtendedFromBit:4) = 7 .  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4920
    self assert:( 2r1111 signExtendedFromBit:4) = -1 .
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4921
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4922
    "Created: / 21-07-2017 / 15:15:53 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4923
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  4924
2263
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4925
testZigZagCoding
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4926
    "zigzag is used by google's protocol buffer encoding"
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4927
    
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4928
    #(1 7 8 
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4929
      16r1fffFFFF 16r-1fffFFFF
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4930
      16r20000000 16r-20000000
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4931
      16r3fffFFFF 16r-3fffFFFF
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4932
      16r40000000 16r-40000000
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4933
      16r7fffFFFF 16r-7fffFFFF
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4934
      16r-80000000
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4935
    ) do:[:val |
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4936
        self assert:(val zigZagEncoded32BitValue zigZagDecodedValue) = val.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4937
        self assert:(val zigZagEncoded64BitValue zigZagDecodedValue) = val.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4938
    ].
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4939
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4940
    #(
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4941
      16r1fffFFFFffffFFFF 16r-1fffFFFFffffFFFF
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4942
      16r2000000000000000 16r-2000000000000000
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4943
      16r3fffFFFFffffFFFF 16r-3fffFFFFffffFFFF
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4944
      16r4000000000000000 16r-4000000000000000
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4945
      16r7fffFFFFffffFFFF 16r-7fffFFFFffffFFFF
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4946
      16r-8000000000000000
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4947
    ) do:[:val |
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4948
        self assert:(val zigZagEncoded64BitValue zigZagDecodedValue) = val.
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4949
    ].
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4950
7b3944adf308 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  4951
    "Created: / 04-06-2019 / 01:10:43 / Claus Gittinger"
2110
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4952
! !
9770bb13c9e9 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 1901
diff changeset
  4953
316
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4954
!IntegerTest methodsFor:'tests-class protocol'!
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4955
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4956
testCreationFromBytes1
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4957
  "self run: #testCreationFromBytes1"
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4958
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  4959
  " it is illegal for a LargeInteger to be less than SmallInteger maxVal."
934
bf29a53f0eba class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
  4960
  " here we test that Integer>>byte!!byte2:byte3:byte4: reconstructs SmallInteger maxVal as an instance of SmallInteger. "
bf29a53f0eba class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
  4961
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  4962
   | maxSmallInt hexString
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  4963
     byte1 byte2 byte3 byte4
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  4964
     byte5 byte6 byte7 byte8
934
bf29a53f0eba class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
  4965
     builtInteger builtIntegerH builtIntegerL|
316
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4966
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4967
    maxSmallInt := SmallInteger maxVal.
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4968
    hexString := maxSmallInt printStringHex.
934
bf29a53f0eba class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
  4969
    ExternalAddress pointerSize == 8 ifTrue:[
1318
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4970
	self assert: hexString size = 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4971
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4972
	byte8 := Integer readFrom: (hexString copyFrom: 1 to: 2) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4973
	byte7 := Integer readFrom: (hexString copyFrom: 3 to: 4) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4974
	byte6 := Integer readFrom: (hexString copyFrom: 5 to: 6) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4975
	byte5 := Integer readFrom: (hexString copyFrom: 7 to: 8) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4976
	byte4 := Integer readFrom: (hexString copyFrom: 9 to: 10) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4977
	byte3 := Integer readFrom: (hexString copyFrom: 11 to: 12) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4978
	byte2 := Integer readFrom: (hexString copyFrom: 13 to: 14) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4979
	byte1 := Integer readFrom: (hexString copyFrom: 15 to: 16) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4980
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4981
	builtIntegerH := Integer byte1: byte5 byte2: byte6 byte3: byte7 byte4: byte8.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4982
	builtIntegerL := Integer byte1: byte1 byte2: byte2 byte3: byte3 byte4: byte4.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4983
	builtInteger := (builtIntegerH bitShift:32) bitOr:builtIntegerL.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4984
	self assert: builtInteger = maxSmallInt.
934
bf29a53f0eba class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
  4985
    ] ifFalse:[
1318
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4986
	self assert: hexString size = 8.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4987
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4988
	byte4 := Integer readFrom: (hexString copyFrom: 1 to: 2) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4989
	byte3 := Integer readFrom: (hexString copyFrom: 3 to: 4) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4990
	byte2 := Integer readFrom: (hexString copyFrom: 5 to: 6) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4991
	byte1 := Integer readFrom: (hexString copyFrom: 7 to: 8) base: 16.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4992
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4993
	builtInteger := Integer byte1: byte1 byte2: byte2 byte3: byte3 byte4: byte4.
8c891b59469c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  4994
	self assert: builtInteger = maxSmallInt.
316
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4995
    ].
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4996
    self assert: builtInteger class = SmallInteger
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4997
! !
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4998
d2d718967147 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
  4999
!IntegerTest methodsFor:'tests-concrete bugs'!
104
baa58c703a71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 103
diff changeset
  5000
238
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5001
test_gcdBug1
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5002
    |theBase theMersenne theRest theGcd theOldRest theOldGcd theFactorOrder|
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  5003
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  5004
    theBase := 2.
1221
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  5005
    132 to:135 do:[:theOrder |
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5006
        false " here i replaced some piece of code by false just to reproduce the error without having to ship all my code " ifFalse:[
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5007
            theRest := ((theBase raisedTo:theOrder) - 1) / (theBase - 1).
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5008
            30 "theOrder - 1" to:67 do:[:theFactorOrderArg |
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5009
                theFactorOrder := theFactorOrderArg.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5010
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5011
                "/Transcript show:theOrder; space.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5012
                "/Transcript showCR:theFactorOrder.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5013
                (theOrder \\ theFactorOrder) = 0 ifTrue:[
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5014
                    "  is a divisor of the order "
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5015
                    self assert:theFactorOrder ~= 131 description:'131 ist kein Teiler von 132'.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5016
                    self assert:(theOrder / theFactorOrder) isFraction not.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5017
                    theMersenne := ((theBase raisedTo:theFactorOrder) - 1) / (theBase - 1).
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5018
                    theGcd := theRest gcd:theMersenne.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5019
                    [ theGcd > 1 ] whileTrue:[
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5020
                        self assert:theFactorOrder < 129.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5021
                        theOldRest := theRest asString.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5022
                        theOldGcd := theGcd asString.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5023
                        theRest := theRest / theGcd.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5024
                        theGcd := theGcd gcd:theRest.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5025
                        self assert:((theRest \\ theGcd) = 0).
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5026
                        self assert:(theRest / theGcd) isFraction not.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5027
                    ].
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5028
                ].
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5029
            ].
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5030
            self assert:theRest ~= 1
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5031
                description:'there is no prime factor of order theOrder'
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5032
        ].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  5033
    ].
238
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5034
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5035
    "
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5036
     self new test_gcdBug1
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5037
    "
564
4606c52eb488 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
  5038
    "Modified: / 27-04-2010 / 00:02:02 / cg"
238
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5039
!
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5040
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5041
test_gcdBug2
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5042
    |theBase theMersenne theRest theGcd theOldRest theOldGcd theFactorOrder|
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  5043
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  5044
    theBase := 2.
1221
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  5045
    132 to:135 do:[:theOrder |
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5046
        false "here i replaced some piece of code by false just to
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5047
         reproduce the error without having to ship all my code "
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5048
                ifFalse:[
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5049
                    theRest := ((theBase raisedTo:theOrder) - 1) / (theBase - 1).
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5050
                    60 "theOrder - 1" to:67 do:[:theFactorOrderArg |
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5051
                        theFactorOrder := theFactorOrderArg.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5052
                        "/Transcript show:theOrder; space.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5053
                        "/Transcript showCR:theFactorOrder.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5054
                        (theOrder \\ theFactorOrder) = 0 ifTrue:[
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5055
                            " is a divisor of the order "
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5056
                            self assert:theFactorOrder ~= 131 description:'131 ist kein Teiler von 132'.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5057
                            self assert:(theOrder / theFactorOrder) isFraction not.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5058
                            theMersenne := ((theBase raisedTo:theFactorOrder) - 1) / (theBase - 1).
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5059
                            theGcd := theRest gcd:theMersenne.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5060
                            [ theGcd > 1 ] whileTrue:[
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5061
                                self assert:theFactorOrder < 129.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5062
                                theOldRest := theRest asString.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5063
                                theOldGcd := theGcd asString.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5064
                                theRest := theRest / theGcd.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5065
                                theGcd := theGcd gcd:theRest.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5066
                                self assert:((theRest \\ theGcd) = 0).
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5067
                                self assert:(theRest / theGcd) isFraction not.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5068
                            ].
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5069
                        ].
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5070
                    ].
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5071
                    self assert:theRest ~= 1
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5072
                        description:'there is no prime factor of order theOrder'
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5073
                ].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  5074
    ].
238
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5075
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5076
    "
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5077
     self new test_gcdBug2
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5078
    "
564
4606c52eb488 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
  5079
    "Modified: / 27-04-2010 / 00:02:09 / cg"
238
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5080
!
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5081
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5082
test_gcdBug3
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5083
    |theBase theMersenne theRest theGcd theOldRest theOldGcd theFactorOrder|
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  5084
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  5085
    theBase := 2.
1221
25d244f98de4 added factorial tests (tests largint * smallInt and largeInt / smallInt)
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
  5086
    132 to:135 do:[:theOrder |
1785
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5087
        false " here i replaced some piece of code by false just to
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5088
         reproduce the error without having to ship all my code"
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5089
                ifFalse:[
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5090
                    theRest := ((theBase raisedTo:theOrder) - 1) / (theBase - 1).
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5091
                    2 to:theOrder - 1 do:[:theFactorOrderArg |
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5092
                        theFactorOrder := theFactorOrderArg.              
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5093
                        "/Transcript show:theOrder; space.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5094
                        "/Transcript showCR:theFactorOrder.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5095
                        (theOrder \\ theFactorOrder) = 0 ifTrue:[
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5096
                            " is a divisor of the order"
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5097
                            self assert:theFactorOrder ~= 131 description:'131 ist kein Teiler von 132'.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5098
                            self assert:(theOrder / theFactorOrder) isFraction not.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5099
                            theMersenne := ((theBase raisedTo:theFactorOrder) - 1) / (theBase - 1).
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5100
                            theGcd := theRest gcd:theMersenne.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5101
                            [ theGcd > 1 ] whileTrue:[
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5102
                                self assert:theFactorOrder < 129.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5103
                                theOldRest := theRest asString.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5104
                                theOldGcd := theGcd asString.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5105
                                theRest := theRest / theGcd.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5106
                                theGcd := theGcd gcd:theRest.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5107
                                self assert:((theRest \\ theGcd) = 0).
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5108
                                self assert:(theRest / theGcd) isFraction not.
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5109
                            ].
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5110
                        ].
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5111
                    ].
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5112
                    self assert:theRest ~= 1
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5113
                        description:'there is no prime factor of order theOrder'
3f585cff357f #BUGFIX by sr
sr
parents: 1717
diff changeset
  5114
                ].
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  5115
    ].
238
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5116
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5117
    "
1139
1dfea13c4d57 class: RegressionTests::IntegerTest
Stefan Vogel <sv@exept.de>
parents: 1069
diff changeset
  5118
     self new test_gcdBug3
238
41116eb0ebba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 206
diff changeset
  5119
    "
564
4606c52eb488 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
  5120
    "Modified: / 27-04-2010 / 00:02:15 / cg"
104
baa58c703a71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 103
diff changeset
  5121
! !
baa58c703a71 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 103
diff changeset
  5122
1298
4a316075f201 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  5123
!IntegerTest methodsFor:'tests-misc'!
4a316075f201 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  5124
2499
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5125
testAssociationWithInteger
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5126
    "ensure the association creation by -> 
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5127
     works with integers"
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5128
    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5129
    self assert:(0->0) = (Association key:0 value:0).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5130
    self assert:(0->1) = (Association key:0 value:1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5131
    self assert:(0 ->0) = (Association key:0 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5132
    self assert:(0 ->1) = (Association key:0 value:1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5133
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5134
    self assert:(1->0) = (Association key:1 value:0).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5135
    self assert:(1->1) = (Association key:1 value:1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5136
    self assert:(1 ->0) = (Association key:1 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5137
    self assert:(1 ->1) = (Association key:1 value:1).  
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5138
2500
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5139
    "/ undef behavior 
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5140
"/    self assert:(0->-0) = (Association key:0 value:0).
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5141
"/    self assert:(0->-1) = (Association key:0 value:-1).
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5142
"/    self assert:(0 ->-0) = (Association key:0 value:0).    
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5143
"/    self assert:(0 ->-1) = (Association key:0 value:-1).
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5144
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5145
"/    self assert:(1->-0) = (Association key:1 value:0).
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5146
"/    self assert:(1->-1) = (Association key:1 value:-1).
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5147
"/    self assert:(1 ->-0) = (Association key:1 value:0).    
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5148
"/    self assert:(1 ->-1) = (Association key:1 value:-1).  
2499
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5149
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5150
    self assert:(-0->0) = (Association key:0 value:0).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5151
    self assert:(-0->1) = (Association key:0 value:1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5152
    self assert:(-0 ->0) = (Association key:0 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5153
    self assert:(-0 ->1) = (Association key:0 value:1). 
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5154
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5155
    self assert:(-1->0) = (Association key:-1 value:0). 
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5156
    self assert:(-1->1) = (Association key:-1 value:1). 
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5157
    self assert:(-1 ->0) = (Association key:-1 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5158
    self assert:(-1 ->1) = (Association key:-1 value:1).   
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5159
2500
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5160
    "/ undef behavior 
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5161
"/    self assert:(-0->-0) = (Association key:0 value:0).
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5162
"/    self assert:(-0->-1) = (Association key:0 value:-1).
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5163
"/    self assert:(-0 ->-0) = (Association key:0 value:0).    
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5164
"/    self assert:(-0 ->-1) = (Association key:0 value:-1).   
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5165
"/
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5166
"/    self assert:(-1->-0) = (Association key:-1 value:0).     
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5167
"/    self assert:(-1->-1) = (Association key:-1 value:-1).    
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5168
"/    self assert:(-1 ->-0) = (Association key:-1 value:0).    
5fb412ae3c50 #REFACTORING by Stefan Reise
sr
parents: 2499
diff changeset
  5169
"/    self assert:(-1 ->-1) = (Association key:-1 value:-1).  
2499
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5170
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5171
    self assert:(0-> 0) = (Association key:0 value:0).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5172
    self assert:(0-> 1) = (Association key:0 value:1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5173
    self assert:(0 -> 0) = (Association key:0 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5174
    self assert:(0 -> 1) = (Association key:0 value:1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5175
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5176
    self assert:(1-> 0) = (Association key:1 value:0).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5177
    self assert:(1-> 1) = (Association key:1 value:1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5178
    self assert:(1 -> 0) = (Association key:1 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5179
    self assert:(1 -> 1) = (Association key:1 value:1).  
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5180
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5181
    self assert:(0-> -0) = (Association key:0 value:0).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5182
    self assert:(0-> -1) = (Association key:0 value:-1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5183
    self assert:(0 -> -0) = (Association key:0 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5184
    self assert:(0 -> -1) = (Association key:0 value:-1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5185
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5186
    self assert:(1-> -0) = (Association key:1 value:0).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5187
    self assert:(1-> -1) = (Association key:1 value:-1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5188
    self assert:(1 -> -0) = (Association key:1 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5189
    self assert:(1 -> -1) = (Association key:1 value:-1).  
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5190
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5191
    self assert:(-0-> 0) = (Association key:0 value:0).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5192
    self assert:(-0-> 1) = (Association key:0 value:1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5193
    self assert:(-0 -> 0) = (Association key:0 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5194
    self assert:(-0 -> 1) = (Association key:0 value:1). 
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5195
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5196
    self assert:(-1-> 0) = (Association key:-1 value:0). 
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5197
    self assert:(-1-> 1) = (Association key:-1 value:1). 
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5198
    self assert:(-1 -> 0) = (Association key:-1 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5199
    self assert:(-1 -> 1) = (Association key:-1 value:1).   
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5200
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5201
    self assert:(-0-> -0) = (Association key:0 value:0).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5202
    self assert:(-0-> -1) = (Association key:0 value:-1).
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5203
    self assert:(-0 -> -0) = (Association key:0 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5204
    self assert:(-0 -> -1) = (Association key:0 value:-1).   
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5205
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5206
    self assert:(-1-> -0) = (Association key:-1 value:0).     
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5207
    self assert:(-1-> -1) = (Association key:-1 value:-1).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5208
    self assert:(-1 -> -0) = (Association key:-1 value:0).    
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5209
    self assert:(-1 -> -1) = (Association key:-1 value:-1).  
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5210
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5211
    "
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5212
     self basicNew testAssociationWithInteger
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5213
    "
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5214
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5215
    "Created: / 18-12-2019 / 15:16:58 / Stefan Reise"
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5216
!
cdd2a98147b9 #FEATURE by Stefan Reise
sr
parents: 2497
diff changeset
  5217
2395
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5218
testBinco
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5219
     self assert: (10 binomialCoefficient:5) = (10 factorial / (5 factorial * 5 factorial)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5220
     self assert: (100 binomialCoefficient:78) = (100 factorial / (78 factorial * (100-78) factorial)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5221
     self assert: (1000 binomialCoefficient:5) = (1000 factorial / (5 factorial * (1000-5) factorial)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5222
     self assert: (10000 binomialCoefficient:78) = (10000 factorial / (78 factorial * (10000-78) factorial)).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5223
     self assert: (0 binomialCoefficient:0) = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5224
     self assert: (10 binomialCoefficient:10) = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5225
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5226
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5227
     self basicNew testBinco
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5228
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5229
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5230
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5231
testEncodeDecode
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5232
    self assert:(1 encodeAsBCD hexPrintString = '1').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5233
    self assert:(12 encodeAsBCD hexPrintString = '12').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5234
    self assert:(123 encodeAsBCD hexPrintString = '123').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5235
    self assert:(1234 encodeAsBCD hexPrintString = '1234').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5236
    self assert:(12345 encodeAsBCD hexPrintString = '12345').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5237
    self assert:(123456 encodeAsBCD hexPrintString = '123456').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5238
    self assert:(1234567 encodeAsBCD hexPrintString = '1234567').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5239
    self assert:(12345678 encodeAsBCD hexPrintString = '12345678').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5240
    self assert:(123456789 encodeAsBCD hexPrintString = '123456789').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5241
    self assert:(1234567890 encodeAsBCD hexPrintString = '1234567890').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5242
    self assert:(12345678901 encodeAsBCD hexPrintString = '12345678901').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5243
    self assert:(123456789012 encodeAsBCD hexPrintString = '123456789012').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5244
    self assert:(1234567890123 encodeAsBCD hexPrintString = '1234567890123').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5245
    self assert:(12345678901234 encodeAsBCD hexPrintString = '12345678901234').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5246
    self assert:(123456789012345 encodeAsBCD hexPrintString = '123456789012345').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5247
    self assert:(1234567890123456 encodeAsBCD hexPrintString = '1234567890123456').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5248
    self assert:(12345678901234567 encodeAsBCD hexPrintString = '12345678901234567').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5249
    self assert:(123456789012345678 encodeAsBCD hexPrintString = '123456789012345678').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5250
    self assert:(1234567890123456789 encodeAsBCD hexPrintString = '1234567890123456789').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5251
    self assert:(12345678901234567890 encodeAsBCD hexPrintString = '12345678901234567890').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5252
    self assert:(4611686018427387902 encodeAsBCD hexPrintString = '4611686018427387902').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5253
    self assert:(4611686018427387903 encodeAsBCD hexPrintString = '4611686018427387903').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5254
    self assert:(4611686018427387904 encodeAsBCD hexPrintString = '4611686018427387904').
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5255
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5256
    self assert:(16r1 decodeFromBCD = 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5257
    self assert:(16r12 decodeFromBCD = 12).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5258
    self assert:(16r123 decodeFromBCD = 123).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5259
    self assert:(16r1234 decodeFromBCD = 1234).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5260
    self assert:(16r12345 decodeFromBCD = 12345).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5261
    self assert:(16r123456 decodeFromBCD = 123456).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5262
    self assert:(16r1234567 decodeFromBCD = 1234567).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5263
    self assert:(16r12345678 decodeFromBCD = 12345678).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5264
    self assert:(16r123456789 decodeFromBCD = 123456789).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5265
    self assert:(16r1234567890 decodeFromBCD = 1234567890).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5266
    self assert:(16r12345678901 decodeFromBCD = 12345678901).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5267
    self assert:(16r123456789012 decodeFromBCD = 123456789012).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5268
    self assert:(16r1000000000000 decodeFromBCD = 1000000000000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5269
    self assert:(16r0000500000000 decodeFromBCD = 500000000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5270
    self assert:(16r1234500000000 decodeFromBCD = 1234500000000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5271
    self assert:(16r1234567890000 decodeFromBCD = 1234567890000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5272
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5273
    self assert:(16r1234567890123 decodeFromBCD = 1234567890123).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5274
    self assert:(16r12345678901234 decodeFromBCD = 12345678901234).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5275
    self assert:(16r123456789012345 decodeFromBCD = 123456789012345).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5276
    self assert:(16r1234567890123456 decodeFromBCD = 1234567890123456).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5277
    self assert:(16r12345678901234567 decodeFromBCD = 12345678901234567).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5278
    self assert:(16r123456789012345678 decodeFromBCD = 123456789012345678).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5279
    self assert:(16r1234567890123456789 decodeFromBCD = 1234567890123456789).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5280
    self assert:(16r12345678901234567890 decodeFromBCD = 12345678901234567890).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5281
    self assert:(16r4611686018427387902 decodeFromBCD = 4611686018427387902).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5282
    self assert:(16r4611686018427387903 decodeFromBCD = 4611686018427387903).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5283
    self assert:(16r4611686018427387904 decodeFromBCD = 4611686018427387904).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5284
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5285
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5286
     self basicNew testEncodeDecode
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5287
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5288
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5289
    "Modified: / 26.10.1999 / 22:01:35 / stefan"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5290
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5291
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5292
testFactorial
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5293
    "/ <testedMethods: #( (Integer >> #factorial) (Integer >> #*) ) >
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5294
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5295
    self assert:(0 factorial = 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5296
    self assert:(1 factorial = 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5297
    self assert:(2 factorial = 2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5298
    self assert:(10 factorial = 3628800).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5299
    self assert:(11 factorial = 39916800).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5300
    self assert:(12 factorial = 479001600).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5301
    self assert:(13 factorial digitBytes = #[0 204 40 115 1]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5302
    self assert:(13 factorial = 6227020800).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5303
    self assert:(14 factorial digitBytes = #[0 40 59 76 20]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5304
    self assert:(14 factorial = 87178291200).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5305
    self assert:(15 factorial digitBytes = #[0 88 119 119 48 1]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5306
    self assert:(15 factorial = 1307674368000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5307
    self assert:(16 factorial digitBytes = #[0 128 117 119 7 19]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5308
    self assert:(16 factorial = 20922789888000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5309
    self assert:(17 factorial digitBytes = #[0 128 205 238 126 67 1]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5310
    self assert:(17 factorial = 355687428096000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5311
    self assert:(18 factorial digitBytes = #[0 0 115 202 236 190 22]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5312
    self assert:(18 factorial = 6402373705728000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5313
    self assert:(19 factorial digitBytes = #[0 0 137 6 147 43 176 1]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5314
    self assert:(19 factorial = 121645100408832000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5315
    self assert:(20 factorial digitBytes = #[0 0 180 130 124 103 195 33]).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5316
    self assert:(20 factorial = 2432902008176640000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5317
    self assert:(50 factorial = 30414093201713378043612608166064768844377641568960512000000000000).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5318
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5319
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5320
     self basicNew testFactorial
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5321
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5322
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5323
    "Created: / 24-04-2010 / 13:52:23 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5324
    "Modified: / 26-02-2016 / 15:43:16 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5325
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5326
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5327
testGCD
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5328
    "/ <testedMethods: #( (Integer >> #gcd:) ) >
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5329
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5330
    self assert:(9 gcd:6) = 3.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5331
    self assert:(6 gcd:9) = 3.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5332
    self assert:(2 gcd:0) = 2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5333
    self assert:(0 gcd:2) = 2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5334
    self assert:(20 factorial gcd:(5*6*7)) = (5*6*7).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5335
    self assert:(20 factorial gcd:(20 factorial / 20)) = (19 factorial).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5336
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5337
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5338
     self basicNew testGCD
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5339
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5340
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5341
    "Created: / 27-04-2010 / 09:49:31 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5342
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5343
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5344
testIsPowerOfTwo
2397
4ad7fc96b77d #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
  5345
    self assert:(1 isPowerOf2).
4ad7fc96b77d #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
  5346
    self assert:(2 isPowerOf2).
4ad7fc96b77d #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
  5347
    self assert:(4 isPowerOf2).
4ad7fc96b77d #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
  5348
    self assert:(3 isPowerOf2 not).
4ad7fc96b77d #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
  5349
    self assert:(16r100000000000000000000000 isPowerOf2).
4ad7fc96b77d #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
  5350
    self assert:(16r300000000000000000000000 isPowerOf2 not).
2395
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5351
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5352
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5353
     self basicNew testIsPowerOfTwo
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5354
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5355
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5356
    "Created: / 27-04-2010 / 10:35:36 / cg"
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5357
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5358
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5359
testNextPowerOfTwo
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5360
    "/ self assert:(0 nextPowerOf2 = 0).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5361
    self assert:(1 nextPowerOf2 = 1).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5362
    self assert:(2 nextPowerOf2 = 2).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5363
    self assert:(3 nextPowerOf2 = 4).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5364
    self assert:(4 nextPowerOf2 = 4).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5365
    self assert:(5 nextPowerOf2 = 8).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5366
    self assert:(6 nextPowerOf2 = 8).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5367
    self assert:(7 nextPowerOf2 = 8).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5368
    self assert:(8 nextPowerOf2 = 8).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5369
    self assert:(9 nextPowerOf2 = 16).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5370
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5371
    self assert:(22 nextPowerOf2 = 32).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5372
    self assert:(32 nextPowerOf2 = 32).
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5373
    self assert:(16rFFFF nextPowerOf2 = 16r10000).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5374
    self assert:(16r1FFFFFFF nextPowerOf2 = 16r20000000).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5375
    self assert:(16r3FFFFFFF nextPowerOf2 = 16r40000000).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5376
    self assert:(16r7FFFFFFF nextPowerOf2 = 16r80000000).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5377
    self assert:(16rFFFFFFFF nextPowerOf2 = 16r100000000). 
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5378
    self assert:(16r1FFFFFFFFFFFFFFF nextPowerOf2 = 16r2000000000000000).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5379
    self assert:(16r3FFFFFFFFFFFFFFF nextPowerOf2 = 16r4000000000000000).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5380
    self assert:(16r7FFFFFFFFFFFFFFF nextPowerOf2 = 16r8000000000000000).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5381
    self assert:(16rFFFFFFFFFFFFFFFF nextPowerOf2 = 16r10000000000000000).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5382
    self assert:(16rFFFFFFFFFFFFFFFFFFFF nextPowerOf2 = 16r100000000000000000000).  
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5383
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5384
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5385
     self basicNew testNextPowerOfTwo
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5386
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5387
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5388
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5389
testProduct
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5390
    self assert:(1 to:1) product = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5391
    self assert:(1 to:100) product = 100 factorial.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5392
    self assert:(1 to:0) product = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5393
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5394
    self assert:(1 to:1) asArray product = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5395
    self assert:(1 to:100) asArray product = 100 factorial.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5396
    self assert:#() product = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5397
    self assert:#(2) product = 2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5398
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5399
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5400
     self basicNew testSum
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5401
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5402
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5403
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5404
testSum
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5405
    self assert:(1 to:1) sum = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5406
    self assert:(1 to:100) sum = 5050.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5407
    self assert:(1 to:0) sum = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5408
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5409
    self assert:(1 to:1) asArray sum = 1.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5410
    self assert:(1 to:100) asArray sum = 5050.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5411
    self assert:#() sum = 0.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5412
    self assert:#(2) sum = 2.
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5413
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5414
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5415
     self basicNew testSum
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5416
    "
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5417
!
36ac67677f1f #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  5418
1298
4a316075f201 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  5419
test_primes
4a316075f201 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  5420
    self 
4a316075f201 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  5421
        assert: ((1 to: 30) select: [:i | i isPrime] as:Array) 
4a316075f201 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  5422
                            = #(2 3 5 7 11 13 17 19 23 29);
4a316075f201 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  5423
        assert: ((0 to: 30) collect: [:i | i nextPrime] as:Array)
4a316075f201 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  5424
                            = #(2 2 3 5 5 7 7 11 11 11 11 13 13 17 17 17 17 19 19 23 23 23 23 29 29 29 29 29 29 31 31).
4a316075f201 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  5425
! !
4a316075f201 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
  5426
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5427
!IntegerTest methodsFor:'tests-reading & printing'!
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5428
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5429
testLiteralNumbers
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5430
    self assert:(self num_00000000000010000 hexPrintString = '10000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5431
    self assert:(self num_00000000000100000 hexPrintString = '100000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5432
    self assert:(self num_00000000001000000 hexPrintString = '1000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5433
    self assert:(self num_00000000010000000 hexPrintString = '10000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5434
    self assert:(self num_00000000100000000 hexPrintString = '100000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5435
    self assert:(self num_00000001000000000 hexPrintString = '1000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5436
    self assert:(self num_00000010000000000 hexPrintString = '10000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5437
    self assert:(self num_00000100000000000 hexPrintString = '100000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5438
    self assert:(self num_00001000000000000 hexPrintString = '1000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5439
    self assert:(self num_00010000000000000 hexPrintString = '10000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5440
    self assert:(self num_00100000000000000 hexPrintString = '100000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5441
    self assert:(self num_01000000000000000 hexPrintString = '1000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5442
    self assert:(self num_10000000000000000 hexPrintString = '10000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5443
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5444
    self assert:(self num_00000000000007FFF hexPrintString = '7FFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5445
    self assert:(self num_00000000000008000 hexPrintString = '8000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5446
    self assert:(self num_0000000000000FFFF hexPrintString = 'FFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5447
    self assert:(self num_000000000007FFFFF hexPrintString = '7FFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5448
    self assert:(self num_00000000000800000 hexPrintString = '800000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5449
    self assert:(self num_00000000000FFFFFF hexPrintString = 'FFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5450
    self assert:(self num_0000000007FFFFFFF hexPrintString = '7FFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5451
    self assert:(self num_00000000080000000 hexPrintString = '80000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5452
    self assert:(self num_000000000FFFFFFFF hexPrintString = 'FFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5453
    self assert:(self num_0000000FFFFFFFFFF hexPrintString = 'FFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5454
    self assert:(self num_00000FFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5455
    self assert:(self num_000FFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5456
    self assert:(self num_0FFFFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5457
    self assert:(self num_1FFFFFFFFFFFFFFFF hexPrintString = '1FFFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5458
    self assert:(self num_20000000000000000 hexPrintString = '20000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5459
    self assert:(self num_3FFFFFFFFFFFFFFFF hexPrintString = '3FFFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5460
    self assert:(self num_40000000000000000 hexPrintString = '40000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5461
    self assert:(self num_7FFFFFFFFFFFFFFFF hexPrintString = '7FFFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5462
    self assert:(self num_80000000000000000 hexPrintString = '80000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5463
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5464
    self assert:(self num_00000FFFFFFFFFFFE hexPrintString = 'FFFFFFFFFFFE').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5465
    self assert:(self num_00000FFFFFFFFFFFC hexPrintString = 'FFFFFFFFFFFC').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5466
    self assert:(self num_00000FFFFFFFFFFF8 hexPrintString = 'FFFFFFFFFFF8').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5467
    self assert:(self num_00000FFFFFFFFFFF0 hexPrintString = 'FFFFFFFFFFF0').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5468
    self assert:(self num_00000FFFFFFFFFFE0 hexPrintString = 'FFFFFFFFFFE0').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5469
    self assert:(self num_00000FFFFFFFFFFC0 hexPrintString = 'FFFFFFFFFFC0').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5470
    self assert:(self num_00000FFFFFFFFFF80 hexPrintString = 'FFFFFFFFFF80').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5471
    self assert:(self num_00000FFFFFFFFFF00 hexPrintString = 'FFFFFFFFFF00').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5472
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5473
    self assert:(self num_0000000000FFF0000 hexPrintString = 'FFF0000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5474
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5475
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5476
     self basicNew testLiteralNumbers
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5477
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5478
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5479
    "Modified: / 4.6.1999 / 18:41:09 / cg"
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5480
!
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5481
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5482
testPrinting1
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5483
    self assert:(10 printString = '10').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5484
    self assert:(100 printString = '100').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5485
    self assert:(1000 printString = '1000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5486
    self assert:(10000 printString = '10000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5487
    self assert:(100000 printString = '100000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5488
    self assert:(1000000 printString = '1000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5489
    self assert:(10000000 printString = '10000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5490
    self assert:(100000000 printString = '100000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5491
    self assert:(1000000000 printString = '1000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5492
    self assert:(10000000000 printString = '10000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5493
    self assert:(100000000000 printString = '100000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5494
    self assert:(1000000000000 printString = '1000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5495
    self assert:(10000000000000 printString = '10000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5496
    self assert:(100000000000000 printString = '100000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5497
    self assert:(1000000000000000 printString = '1000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5498
    self assert:(10000000000000000 printString = '10000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5499
    self assert:(100000000000000000 printString = '100000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5500
    self assert:(1000000000000000000 printString = '1000000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5501
    self assert:(10000000000000000000 printString = '10000000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5502
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5503
    self assert:(16rF hexPrintString = 'F').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5504
    self assert:(16rFF hexPrintString = 'FF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5505
    self assert:(16rFFF hexPrintString = 'FFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5506
    self assert:(16rFFFF hexPrintString = 'FFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5507
    self assert:(16rFFFFF hexPrintString = 'FFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5508
    self assert:(16rFFFFFF hexPrintString = 'FFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5509
    self assert:(16rFFFFFFF hexPrintString = 'FFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5510
    self assert:(16rFFFFFFFF hexPrintString = 'FFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5511
    self assert:(16rFFFFFFFFF hexPrintString = 'FFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5512
    self assert:(16rFFFFFFFFFF hexPrintString = 'FFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5513
    self assert:(16rFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5514
    self assert:(16rFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5515
    self assert:(16rFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5516
    self assert:(16rFFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5517
    self assert:(16rFFFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5518
    self assert:(16rFFFFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5519
    self assert:(16rFFFFFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5520
    self assert:(16rFFFFFFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5521
    self assert:(16rFFFFFFFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5522
    self assert:(16rFFFFFFFFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5523
    self assert:(16rFFFFFFFFFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5524
    self assert:(16rFFFFFFFFFFFFFFFFFFFFFF hexPrintString = 'FFFFFFFFFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5525
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5526
    self assert:(16r10 hexPrintString = '10').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5527
    self assert:(16r100 hexPrintString = '100').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5528
    self assert:(16r1000 hexPrintString = '1000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5529
    self assert:(16r10000 hexPrintString = '10000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5530
    self assert:(16r100000 hexPrintString = '100000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5531
    self assert:(16r1000000 hexPrintString = '1000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5532
    self assert:(16r10000000 hexPrintString = '10000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5533
    self assert:(16r100000000 hexPrintString = '100000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5534
    self assert:(16r1000000000 hexPrintString = '1000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5535
    self assert:(16r10000000000 hexPrintString = '10000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5536
    self assert:(16r100000000000 hexPrintString = '100000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5537
    self assert:(16r1000000000000 hexPrintString = '1000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5538
    self assert:(16r10000000000000 hexPrintString = '10000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5539
    self assert:(16r100000000000000 hexPrintString = '100000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5540
    self assert:(16r1000000000000000 hexPrintString = '1000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5541
    self assert:(16r10000000000000000 hexPrintString = '10000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5542
    self assert:(16r100000000000000000 hexPrintString = '100000000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5543
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5544
    self assert:(126 printString) = '126'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5545
    self assert:(127 printString) = '127'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5546
    self assert:(128 printString) = '128'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5547
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5548
    self assert:(255 printString) = '255'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5549
    self assert:(256 printString) = '256'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5550
    self assert:(257 printString) = '257'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5551
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5552
    self assert:(32767 printString) = '32767'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5553
    self assert:(32768 printString) = '32768'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5554
    self assert:(32769 printString) = '32769'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5555
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5556
    self assert:(65535 printString) = '65535'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5557
    self assert:(65536 printString) = '65536'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5558
    self assert:(65537 printString) = '65537'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5559
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5560
    self assert:(2147483647 printString) = '2147483647'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5561
    self assert:(2147483648 printString) = '2147483648'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5562
    self assert:(2147483649 printString) = '2147483649'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5563
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5564
    self assert:(4294967295 printString) = '4294967295'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5565
    self assert:(4294967296 printString) = '4294967296'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5566
    self assert:(4294967297 printString) = '4294967297'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5567
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5568
    self assert:(127 printStringRadix:16) = '7F'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5569
    self assert:(123 printStringRadix:12) = 'A3'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5570
    self assert:(123 printStringRadix:10) = '123'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5571
    self assert:(123 printStringRadix:8 ) = '173'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5572
    self assert:(123 printStringRadix:3 ) = '11120'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5573
    self assert:(123 printStringRadix:2 ) = '1111011'.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5574
    self should:[ 123 printStringRadix:1 ] raise:Error.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5575
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5576
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5577
     self basicNew testPrinting1
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5578
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5579
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5580
    "Modified: / 26.10.1999 / 22:01:35 / stefan"
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5581
!
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5582
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5583
testReading1
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5584
    |t|
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5585
2493
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5586
    #(
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5587
        '0'                   0                   '0' 
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5588
        '-0'                  0                   '0' 
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5589
        '00'                  0                   '0' 
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5590
        '000'                 0                   '0' 
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5591
        '0x0'                 0                   '0' 
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5592
        '0b0'                 0                   '0' 
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5593
        '16r0'                0                   '0' 
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5594
        '4865804016353280000' 4865804016353280000 '4865804016353280000'
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5595
    ) inGroupsOf:3 do:[:str :expected :expectedPrintString|
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5596
        self assert:(Integer readFrom:str) = expected.
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5597
        self assert:expected printString = expectedPrintString.
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5598
    ].
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5599
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5600
    self assert:((Integer readFrom:'4294967295') printString = '4294967295').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5601
    self assert:((Integer readFrom:'4294967295') = 4294967295).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5602
    self assert:((Integer readFrom:'4294967296') printString = '4294967296').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5603
    self assert:((Integer readFrom:'4294967296') = 4294967296).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5604
    self assert:((Integer readFrom:'4294967297') printString = '4294967297').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5605
    self assert:((Integer readFrom:'4294967297') = 4294967297).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5606
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5607
    "/ max-smallint on 32bit machines
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5608
    self assert:((Integer readFrom:'1073741823') printString = '1073741823').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5609
    self assert:((Integer readFrom:'1073741823') class == SmallInteger).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5610
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5611
    "/ min-smallint on 32bit machines
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5612
    self assert:((Integer readFrom:'-1073741824') printString = '-1073741824').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5613
    self assert:((Integer readFrom:'-1073741824') class == SmallInteger).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5614
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5615
    "/ max-smallint on 64bit machines
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5616
    self assert:((Integer readFrom:'4611686018427387903') printString = '4611686018427387903').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5617
    SmallInteger maxBytes == 8 ifTrue:[
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5618
        self assert:((Integer readFrom:'4611686018427387903') class == SmallInteger)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5619
    ].
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5620
    "/ max-smallint+1 on 64bit machines
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5621
    self assert:((Integer readFrom:'4611686018427387900') printString = '4611686018427387900').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5622
    SmallInteger maxBytes == 8 ifTrue:[
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5623
        |tt t3 t3b t4a t4b t4c|
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5624
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5625
        self assert:((Integer readFrom:'4611686018427387900') class == SmallInteger).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5626
        tt := (Integer readFrom:'4611686018427387900').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5627
        t3 := tt + 3.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5628
        self assert:(t3 class == SmallInteger).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5629
        self assert:(t3 printString = '4611686018427387903').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5630
        t3b := (self do:tt plus:3).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5631
        self assert:(t3b class == SmallInteger).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5632
        self assert:(t3b printString = '4611686018427387903').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5633
        t4a := t3 + 1.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5634
        self assert:(t4a class == LargeInteger).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5635
        self assert:(t4a printString = '4611686018427387904').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5636
        t4b := tt + 4.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5637
        self assert:(t4b class == LargeInteger).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5638
        self assert:(t4b printString = '4611686018427387904').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5639
        t4c := (self do:tt plus:4).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5640
        self assert:(t4c class == LargeInteger).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5641
        self assert:(t4c printString = '4611686018427387904').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5642
    ].
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5643
    self assert:((Integer readFrom:'4611686018427387904') printString = '4611686018427387904').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5644
    self assert:((Integer readFrom:'4611686018427387904') class == LargeInteger).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5645
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5646
    "/ min-smallint on 64bit machines
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5647
    self assert:((Integer readFrom:'-4611686018427387904') printString = '-4611686018427387904').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5648
    SmallInteger maxBytes == 8 ifTrue:[
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5649
        self assert:((Integer readFrom:'-4611686018427387904') class == SmallInteger)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5650
    ].
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5651
    self assert:((Integer readFrom:'-4611686018427387904') printString = '-4611686018427387904').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5652
    SmallInteger maxBytes == 8 ifTrue:[
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5653
        self assert:((Integer readFrom:'-4611686018427387904') class == SmallInteger)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5654
    ].
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5655
    self assert:((Integer readFrom:'FFFFFFFF' radix:16) hexPrintString = 'FFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5656
    self assert:((Integer readFrom:'FFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5657
    self assert:((Integer readFrom:'FFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5658
    self assert:((Integer readFrom:'FFFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5659
    self assert:((Integer readFrom:'FFFFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5660
    self assert:((Integer readFrom:'FFFFFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5661
    self assert:((Integer readFrom:'FFFFFFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5662
    self assert:((Integer readFrom:'FFFFFFFFFFFFFFF' radix:16) hexPrintString = 'FFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5663
    self assert:((Integer readFrom:'3FFFFFFFFFFFFFF' radix:16) hexPrintString = '3FFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5664
    self assert:((Integer readFrom:'7FFFFFFFFFFFFFF' radix:16) hexPrintString = '7FFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5665
    self assert:((Integer readFrom:'400000000000000' radix:16) hexPrintString = '400000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5666
    self assert:((Integer readFrom:'800000000000000' radix:16) hexPrintString = '800000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5667
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5668
    self assert:((Integer readFrom:'16r-FFFFFFFF') printString = '-4294967295').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5669
    self assert:((Integer readFrom:'16r-FFFFFFFFF') hexPrintString = '-FFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5670
    self assert:((Integer readFrom:'16r-FFFFFFFFFF') hexPrintString = '-FFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5671
    self assert:((Integer readFrom:'16r-FFFFFFFFFFF') hexPrintString = '-FFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5672
    self assert:((Integer readFrom:'16r-FFFFFFFFFFFF') hexPrintString = '-FFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5673
    self assert:((Integer readFrom:'16r-FFFFFFFFFFFFF') hexPrintString = '-FFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5674
    self assert:((Integer readFrom:'16r-FFFFFFFFFFFFFF') hexPrintString = '-FFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5675
    self assert:((Integer readFrom:'16r-FFFFFFFFFFFFFFF') hexPrintString = '-FFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5676
    self assert:((Integer readFrom:'16r-3FFFFFFFFFFFFFF') hexPrintString = '-3FFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5677
    self assert:((Integer readFrom:'16r-7FFFFFFFFFFFFFF') hexPrintString = '-7FFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5678
    self assert:((Integer readFrom:'16r-400000000000000') hexPrintString = '-400000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5679
    self assert:((Integer readFrom:'16r-800000000000000') hexPrintString = '-800000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5680
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5681
    self assert:((Integer readFrom:'10000000' radix:16) hexPrintString = '10000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5682
    self assert:((Integer readFrom:'100000000' radix:16) hexPrintString = '100000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5683
    self assert:((Integer readFrom:'1000000000' radix:16) hexPrintString = '1000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5684
    self assert:((Integer readFrom:'10000000000' radix:16) hexPrintString = '10000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5685
    self assert:((Integer readFrom:'100000000000' radix:16) hexPrintString = '100000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5686
    self assert:((Integer readFrom:'1000000000000' radix:16) hexPrintString = '1000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5687
    self assert:((Integer readFrom:'10000000000000' radix:16) hexPrintString = '10000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5688
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5689
    self assert:((Integer readFrom:'1152921504606846975' radix:10) hexPrintString = 'FFFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5690
    self assert:((Integer readFrom:'288230376151711743' radix:10) hexPrintString = '3FFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5691
    self assert:((Integer readFrom:'576460752303423487' radix:10) hexPrintString = '7FFFFFFFFFFFFFF').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5692
    self assert:((Integer readFrom:'288230376151711744' radix:10) hexPrintString = '400000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5693
    self assert:((Integer readFrom:'576460752303423488' radix:10) hexPrintString = '800000000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5694
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5695
    t := Integer readFrom:'FFFFFFFF' radix:16.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5696
    self assert:((t + 1) hexPrintString = '100000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5697
    t := Integer readFrom:'FFFFFFFFF' radix:16.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5698
    self assert:((t + 1) hexPrintString = '1000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5699
    t := Integer readFrom:'FFFFFFFFFF' radix:16.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5700
    self assert:((t + 1) hexPrintString = '10000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5701
    t := Integer readFrom:'FFFFFFFFFFF' radix:16.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5702
    self assert:((t + 1) hexPrintString = '100000000000').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5703
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5704
    t := Integer readFrom:'10000000' radix:16.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5705
    self assert:((t + 1) hexPrintString = '10000001').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5706
    t := Integer readFrom:'100000000' radix:16.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5707
    self assert:((t + 1) hexPrintString = '100000001').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5708
    t := Integer readFrom:'1000000000' radix:16.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5709
    self assert:((t + 1) hexPrintString = '1000000001').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5710
    t := Integer readFrom:'10000000000' radix:16.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5711
    self assert:((t + 1) hexPrintString = '10000000001').
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5712
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5713
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5714
     self basicNew testReading1
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5715
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5716
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5717
    "Modified: / 19-09-2017 / 16:27:56 / stefan"
2493
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5718
    "Modified: / 17-12-2019 / 14:39:03 / Stefan Reise"
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5719
!
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5720
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5721
testReading2
2497
2813495dcedb #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
  5722
    self assert:(Integer readFrom:'1000000001010' radix:2) = 4106.  
2813495dcedb #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
  5723
    self assert:(Integer readFrom:'-1000000001010' radix:2) = -4106.  
2813495dcedb #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
  5724
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5725
    #(
2493
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5726
        0
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5727
        -0
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5728
        00
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5729
        000
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5730
        0x0
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5731
        0b0
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5732
        16r0
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5733
        305419896
2497
2813495dcedb #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
  5734
        0x100A
2813495dcedb #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
  5735
        -0x100A
2813495dcedb #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
  5736
        16r100A
2813495dcedb #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
  5737
        16r-100A
2813495dcedb #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
  5738
        -16r100A
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5739
        16r1FFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5740
        16r3FFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5741
        16r7FFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5742
        16rFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5743
        16r1FFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5744
        16r3FFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5745
        16r7FFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5746
        16rFFFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5747
        16r1FFFFFFFFFFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5748
        16r3FFFFFFFFFFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5749
        16r7FFFFFFFFFFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5750
        16rFFFFFFFFFFFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5751
        16r1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5752
        16r3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5753
        16r7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5754
        16rFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5755
    ) do:[:each | 
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5756
        |s|
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5757
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5758
        2 to:35 do:[:radix |
2497
2813495dcedb #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
  5759
            |got|
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5760
            s := each printStringRadix:radix.
2497
2813495dcedb #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
  5761
            self assert:(got := Integer readFrom:s radix:radix) = each
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5762
        ]
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5763
    ].
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5764
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5765
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5766
     self basicNew testReading2
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5767
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5768
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5769
    "Created: / 27-03-2019 / 18:00:54 / Claus Gittinger"
2493
1ad4f76256d0 #QUALITY by Stefan Reise
sr
parents: 2492
diff changeset
  5770
    "Modified: / 17-12-2019 / 14:34:58 / Stefan Reise"
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5771
!
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5772
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5773
testReading3
2332
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5774
    "thousands character - german and switzerland"
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5775
    
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5776
    #(
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5777
        ('1.234'        1234)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5778
        ('1.234.567'    1234567)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5779
        ('1234.567'     1234567)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5780
        ('12345.67'     nil)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5781
        ('12345.6789'   nil)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5782
        ('12345.'       nil)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5783
        ('12345.1'      nil)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5784
        ('12345.a'      nil)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5785
    ) pairsDo:[:string :expected |
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5786
        |value|
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5787
        
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5788
        value := Integer 
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5789
                    fromString:string
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5790
                    decimalPointCharacter:$, 
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5791
                    thousandsSeparator:$. 
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5792
                    onError:nil.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5793
        self assert:(value = expected)            
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5794
    ].
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5795
2332
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5796
    #(
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5797
        ('1''234'       1234)
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5798
        ('1''234''567'  1234567)
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5799
        ('1234''567'    1234567)
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5800
        ('12345.67'     nil)
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5801
        ('12345.6789'   nil)
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5802
        ('12345.'       nil)
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5803
        ('12345.1'      nil)
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5804
        ('12345.a'      nil)
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5805
    ) pairsDo:[:string :expected |
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5806
        |value|
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5807
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5808
        value := Integer 
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5809
                    fromString:string
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5810
                    decimalPointCharacter:$, 
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5811
                    thousandsSeparator:$' 
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5812
                    onError:nil.
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5813
        self assert:(value = expected)            
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5814
    ].
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5815
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5816
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5817
     self basicNew testReading3
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5818
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5819
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5820
    "Created: / 21-07-2019 / 19:51:58 / Claus Gittinger"
2332
f30d7df1a177 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  5821
    "Modified (comment): / 21-07-2019 / 21:08:18 / Claus Gittinger"
2331
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5822
!
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5823
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5824
testReading4
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5825
    "thousands character - us"
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5826
    
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5827
    #(
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5828
        ('1,234'        1234)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5829
        ('1,234,567'    1234567)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5830
        ('1234,567'     1234567)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5831
        ('12345,67'     nil)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5832
        ('12345,6789'   nil)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5833
        ('12345,'       nil)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5834
        ('12345,1'      nil)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5835
        ('12345,a'      nil)
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5836
    ) pairsDo:[:string :expected |
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5837
        |value|
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5838
        
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5839
        value := Integer 
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5840
                    fromString:string
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5841
                    decimalPointCharacter:$. 
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5842
                    thousandsSeparator:$, 
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5843
                    onError:nil.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5844
        self assert:(value = expected)            
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5845
    ].
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5846
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5847
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5848
     self basicNew testReading4
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5849
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5850
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5851
    "Created: / 21-07-2019 / 19:54:51 / Claus Gittinger"
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5852
!
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5853
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5854
testReadingPrinting1
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5855
    |nr inString outString|
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5856
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5857
    #(2 3 4 5 8 10 16) do:[:radix |
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5858
        "/ Transcript showCR:('testing radix %1...' bindWith:radix).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5859
        1 to:1000 do:[:len |
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5860
            inString := '1',(String new:len withAll:$0).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5861
            nr := Integer readFrom:inString radix:radix.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5862
            outString := nr printStringRadix:radix.
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5863
            self assert:(outString = inString) description:('read/print failed for radix ',radix printString).
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5864
        ].    
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5865
    ].
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5866
    
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5867
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5868
     self basicNew testReadingPrinting1
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5869
    "
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5870
! !
ebd02b4587a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5871
2
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  5872
!IntegerTest class methodsFor:'documentation'!
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  5873
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  5874
version
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  5875
    ^ '$Header$'
563
d666bfa81a9a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  5876
!
d666bfa81a9a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  5877
d666bfa81a9a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  5878
version_CVS
d666bfa81a9a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  5879
    ^ '$Header$'
2
7105b918a4a0 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  5880
! !
1234
920a33e66069 class: RegressionTests::IntegerTest
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
  5881