P2Number

An object used for comparing and counting

Factory Messages
OperationDescription

Operational Messages
OperationReturnDescription
< aNumber boolean Answer true if the receiver is less than aNumber else answer false
> aNumber boolean Answer true if the receiver is greater than aNumber else answer false
<= aNumber boolean Answer true if the receiver is less than or equal to aNumber else answer false
>= aNumber boolean Answer true if the receiver is greater than or equal to aNumber else answer false
== aNumber boolean Answer true if the receiver is equal to aNumber else answer false
!= aNumber boolean Answer true if the receiver is not equal to aNumber else answer false
+ aNumber BigDecimal Answer the result of adding the receiver and aNumber
- aNumber BigDecimal Answer the result of subtracting aNumber from the receiver
* aNumber BigDecimal Answer the result of multiplying the receiver and aNumber
/ aNumber BigDecimal Answer the result of dividing the receiver by aNumber
random BigDecimal Answer a random number depending upon the value of the receiver:
0 => random long value
n => random integer >=0 and < n
n.m => random double >= 0.0 and < 1.0
do: aBlock self Execute aBlock this number of times. C.f. a for loop. The iteration number is given as an argument to aBlock. The number starts at 0. Answers receiver
collect: aBlock P2Array Execute aBlock this number of times. C.f. a for loop. The iteration number is given as an argument to aBlock. The number starts at 0. Answers an array with a collection of all the results of the block executions.