Companion

object Companion

Functions

Link copied to clipboard
fun cachedSquareOfQuintillion(n: Int): A_Number

Answer the nth successive square of a (U.S.) quintillion, which will be (10^18)^(2^n). N must be ≥ 0. Cache this number for performance.

Link copied to clipboard
fun computeHashOfInt(anInt: Int): Int

Hash the passed Int. Note that it must have the same value as what computeHashOfIntegerObject would return, given an encoding of the Int as an Avail integer.

Link copied to clipboard
fun computeHashOfLong(aLong: Long): Int

Hash the passed Long. Note that it must have the same value as what computeHashOfIntegerObject would return, given an encoding of the Long as an Avail integer. Even if that integer is within the 32-bit Int range.

Link copied to clipboard
fun createUninitializedInteger(size: Int): AvailObject

Create a mutable Avail integer with the specified number of uninitialized Int slots.

Link copied to clipboard
fun extractDoubleScaled(self: AvailObject, exponentBias: Int): Double

Extract a double from this integer, but scale it down by the specified power of two in the process. If the integer is beyond the scale of a double but the scale would bring it in range, don't overflow.

Link copied to clipboard
fun fromBigInteger(bigInteger: BigInteger): A_Number

Create an Avail integer that is the numerical equivalent of the given Java BigInteger.

Link copied to clipboard
fun fromInt(anInteger: Int): AvailObject

Convert the specified Kotlin Int into an Avail integer.

Link copied to clipboard
fun fromLong(aLong: Long): AvailObject

Convert the specified Long into a boxed Avail integer.

Link copied to clipboard
fun fromUnsignedByte(anInteger: Short): AvailObject

Convert the specified byte-valued Java short into an Avail integer.

Link copied to clipboard
fun hashOfUnsignedByte(anInteger: Short): Int

Answer the Int hash value of the given Short in the range 0..255 inclusive.

Link copied to clipboard
fun intCount(self: AvailObject): Int

Answer the number of int slots in the passed integer object, which must not be an indirection.

Link copied to clipboard
fun negativeOne(): A_Number

Answer an AvailObject representing the integer negative one (-1).

Link copied to clipboard
fun truncatedFromDouble(aDouble: Double): A_Number

Answer an Avail integer that holds the truncation of the double argument, rounded towards zero.

Properties

Link copied to clipboard
val fromIntMethod: CheckedMethod
Link copied to clipboard
var negativeOne: AvailObject

The Avail integer negative one (-1).

Link copied to clipboard
val one: AvailObject

An Avail integer representing one (1).

Link copied to clipboard
val two: AvailObject

An Avail integer representing two (2).

Link copied to clipboard
val zero: AvailObject

An Avail integer representing zero (0).