1 + 2.3
-> 3.31 class
-> SmallInteger1 class maxVal class
-> SmallInteger(1 class maxVal + 1) class
-> LargePositiveInteger(1/3) + (2/3)
-> 1 1000 factorial / 999 factorial
-> 10002/3 + 1
-> (5/3)SmallInteger
1 class
> SmallInteger
But small integers are heavily optimized
2 raisedTo: 30
> 1073741823
SmallInteger maxVal
> 1073741823
What is the largest small integer?
1 class maxVal
> 1073741823
What is the smallest large integer?
1 class maxVal +1
> 1073741824
(1 class maxVal + 1) class
> LargePositiveInteger
factorial
is not optimized
1000 factorial numberOfDigits
> 2568
100000 factorial numberOfDigits
> 456574
Fraction
denominator
, numerator
, ....1000 factorial / 999 factorial
> 1000
(1 / 3) + (2 / 3)
>1
2 / 3 + 1
> 5 / 3
2 * 3 + 5
> 11
2 + 3 * 5
> 25 !!!
2 + (3 * 5)
> 11
@
or x:y:
10 @ 100
(10 @ 100) x
> 10
(10 @ 100) y
>100
Alternative
Point new x: 100 y: 100
Class written in a functional way: Most Point
methods are returning new points
areasOutside:
, expandBy:
, insetBy:
, intersect:
Rectangle left: 10 right: 100 top: 20 bottom: 40
> (10@20) corner: (100@40)
Rectangle origin: 20@20 corner: 100@200
Point
, Rectangle
, Margin
/