Companion

object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Extract a Kotlin Double from the receiver.

Link copied to clipboard

Extract a Java float from the receiver.

Link copied to clipboard

Extract a 32-bit signed Kotlin Int from the receiver.

Link copied to clipboard

Extract a 64-bit signed Java Long from the receiver.

Link copied to clipboard

Extract an unsigned nybble from the receiver. Return it as a Java Byte.

Link copied to clipboard

Extract a signed byte from the receiver.

Link copied to clipboard

Extract a signed short from the receiver.

Link copied to clipboard

Extract an unsigned byte from the receiver. Return it in a Java Short to avoid sign bit reinterpretation.

Link copied to clipboard

Extract an unsigned short from the receiver. Return it in a Kotlin Int to avoid sign bit reinterpretation.

Link copied to clipboard

Answer whether this value is a double-precision floating point number.

Link copied to clipboard
Link copied to clipboard

Answer whether this value is a single-precision floating point number.

Link copied to clipboard

Answer whether this value is an integer in the i32 range.

Link copied to clipboard
Link copied to clipboard

Answer whether this value is an integer in the i64 range.

Link copied to clipboard

Answer whether this number is numerically equal to some finite integer.

Link copied to clipboard

Answer whether this integral infinity is positive.

Link copied to clipboard

Answer whether this value is an integer in the range [-128..127].

Link copied to clipboard

Answer whether this value is an integer in the range [-32768..32767].

Link copied to clipboard

Answer whether this value is an integer in the range [0..65535].

Link copied to clipboard

Given an Avail integer, answer which power of two it is. 1->0, 2->1, 4->2, 8->3, etc. If the number is not a power of two, answer -1.

Functions

Link copied to clipboard
fun A_Number.addToDoubleCanDestroy(doubleObject: A_Number, canDestroy: Boolean): A_Number

Add the receiver to the given double, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be a double rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard
fun A_Number.addToFloatCanDestroy(floatObject: A_Number, canDestroy: Boolean): A_Number

Add the receiver to the given float, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be a float rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard

Add the receiver to the integral infinity with the given Sign, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be an integral infinity rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard

Add the receiver to the given finite integer, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be an integer rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard

Convert the receiver, which must be an integer, into a Java BigInteger.

Link copied to clipboard
fun A_Number.bitSet(bitPosition: Int, value: Boolean, canDestroy: Boolean): A_Number

Produce an integer like the receiver, but with the bit corresponding to 2^bitPosition either set or cleared, depending on value. The receiver may be recycled or destroyed if canDestroy is true.

Link copied to clipboard
fun A_Number.bitShift(shiftFactor: A_Number, canDestroy: Boolean): A_Number

Shift this integer left by the specified number of bits. If the shift amount is negative, perform a right shift instead (of the negation of the specified amount). In the case that the receiver is negative, shift in zeroes on the right or ones on the left.

Link copied to clipboard
fun A_Number.bitShiftLeftTruncatingToBits(shiftFactor: A_Number, truncationBits: A_Number, canDestroy: Boolean): A_Number

Shift the non-negative integer to the left by the specified number of bits, then truncate the representation to force bits above the specified position to be zeroed. The shift factor may be negative, indicating a right shift by the corresponding positive amount, in which case truncation will still happen.

Link copied to clipboard
fun A_Number.bitTest(bitPosition: Int): Boolean

Extract the bit with value 2^bitPosition from the integer, as a Boolean.

Link copied to clipboard
fun A_Number.bitwiseAnd(anInteger: A_Number, canDestroy: Boolean): A_Number

Compute the boolean and operation for the corresponding bits of the receiver and anInteger. Both values are signed 2's complement integers.

Link copied to clipboard
fun A_Number.bitwiseOr(anInteger: A_Number, canDestroy: Boolean): A_Number

Compute the boolean or operation for the corresponding bits of the receiver and anInteger. Both values are signed 2's complement integers.

Link copied to clipboard
fun A_Number.bitwiseXor(anInteger: A_Number, canDestroy: Boolean): A_Number

Compute the boolean exclusive-or operation for the corresponding bits of the receiver and anInteger. Both values are signed 2's complement integers.

Link copied to clipboard
fun A_Number.divideCanDestroy(aNumber: A_Number, canDestroy: Boolean): A_Number

Divide the receiver by the argument aNumber and answer the result.

Link copied to clipboard

Divide the double argument by the receiver, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be a double rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard

Divide the float argument by the receiver, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be a float rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard

Divide the infinity having the specified Sign by the receiver, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be an infinity rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard

Divide the Avail integer argument by the receiver, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be an integer rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Answer whether the receiver is an infinity with the specified Sign.

Link copied to clipboard

Determine if the receiver is an Avail integer equivalent to the specified Kotlin Int. Note that a non-integer should simply answer false, not fail. This operation was placed in A_Number for organizational reasons, not type restriction.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Answer whether the receiver is numerically greater than or equivalent to the argument.

Link copied to clipboard

Answer whether the receiver is numerically greater than the argument.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Answer whether the receiver is numerically less than or equivalent to the argument.

Link copied to clipboard

Answer whether the receiver is numerically less than the argument.

Link copied to clipboard
fun A_Number.minusCanDestroy(aNumber: A_Number, canDestroy: Boolean): A_Number

Subtract the argument aNumber from a receiver and answer the result.

Link copied to clipboard
fun minusStatic(self: AvailObject, aNumber: AvailObject, canDestroy: Boolean): AvailObject
Link copied to clipboard

Multiply the receiver by the given double, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be a double rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard

Multiply the receiver by the given float, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be a float rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard

Multiply the receiver by the infinity with the given sign, potentially destroying the receiver if it's mutable and canDestroy is true.

Link copied to clipboard

Multiply the receiver by the given integer, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be an integer rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard

Divide the receiver by the argument aNumber and answer the result. The operation is not allowed to fail, so the caller must ensure that the arguments are valid, i.e. the divisor is not zero.

Link copied to clipboard

Difference the receiver and the argument aNumber and answer the result. The operation is not allowed to fail, so the caller must ensure that the arguments are valid, i.e. not infinities of like sign.

Link copied to clipboard

Add the receiver and the argument aNumber and answer the result. The operation is not allowed to fail, so the caller must ensure that the arguments are valid, i.e. not infinities of unlike sign.

Link copied to clipboard

Multiply the receiver and the argument aNumber and answer the result. The operation is not allowed to fail, so the caller must ensure that the arguments are valid, i.e. not zero and infinity.

Link copied to clipboard

Answer an ordering between the receiver and the argument. This compares the underlying real numeric values of the two A_Numbers, which does not necessarily agree with the equals semantics. In particular, under numerical ordering, 5 = 5.0 = 5.0f, and 0.0/0.0 is incomparable to every number, even itself. Under ordinary equality (the equals method), an integer never equals a float, and neither ever equals a double. However, 0.0/0.0 is equal to 0.0/0.0, since they have the same kind (double) and the same bit pattern. Note that hash agrees with general equality, not the numeric ordering.

Link copied to clipboard

This produces the same value as numericCompare, but the argument is an unboxed double value.

Link copied to clipboard

This produces the same value as numericCompare, but the argument is known to be an integral infinity whose Sign is provided.

Link copied to clipboard

This produces the same value as numericCompare, but the argument is known to be an integer.

Link copied to clipboard
fun A_Number.plusCanDestroy(aNumber: A_Number, canDestroy: Boolean): A_Number

Add the receiver and the argument aNumber and answer the result.

Link copied to clipboard

Extract a (signed) base 2^32 digit from the integer. The index must be in range for the integer's representation.

Link copied to clipboard

Replace a (signed) base 2^32 digit of the integer. The index must be in range for the integer's representation, and the receiver must be mutable.

Link copied to clipboard

Extract an unsigned base 2^32 digit from the integer. The index must be in range for the integer's representation.

Link copied to clipboard

Replace an unsigned base 2^32 digit of the integer. The index must be in range for the integer's representation, and the receiver must be mutable.

Link copied to clipboard

Subtract the receiver from the given double, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be a double rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard

Subtract the receiver from the given float, destroying one or the other if it's mutable and canDestroy is true. Because of the requirement that the argument be a float rather than an arbitrary A_Number, this is usually only used for double-dispatching.

Link copied to clipboard

Subtract the receiver from the infinity with the specified sign, destroying one or the other if it's mutable and canDestroy is true.

Link copied to clipboard

Subtract the receiver from the given integer, destroying one or the other if it's mutable and canDestroy is true.

Link copied to clipboard
fun A_Number.timesCanDestroy(aNumber: A_Number, canDestroy: Boolean): A_Number

Multiply the receiver and the argument aNumber and answer the result.

Link copied to clipboard
fun timesStatic(self: AvailObject, aNumber: AvailObject, canDestroy: Boolean): AvailObject
Link copied to clipboard

Normalize the integer to have the minimum number of base 2^32 digits.