Class SafeInteger
java.lang.Object
java.lang.Number
com.oracle.truffle.js.runtime.SafeInteger
- All Implemented Interfaces:
com.oracle.truffle.api.interop.TruffleObject,Serializable,Comparable<SafeInteger>
public final class SafeInteger
extends Number
implements Comparable<SafeInteger>, com.oracle.truffle.api.interop.TruffleObject
This type represents an integer value in the range of -(253-1) to -253-1,
i.e. the range of integers that can be safely represented as double values, such that for each n,
{n, n - 1, n + 1} are exactly representable as double values.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddExact(SafeInteger other) intcompareTo(SafeInteger other) doublebooleanfloatinthashCode()intintValue()booleanlongtoString()static SafeIntegervalueOf(int value) static SafeIntegervalueOf(long value) Methods inherited from class java.lang.Number
byteValue, shortValue
-
Method Details
-
valueOf
-
valueOf
-
intValue
-
longValue
-
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
equals
-
hashCode
-
compareTo
- Specified by:
compareToin interfaceComparable<SafeInteger>
-
toString
-
isNegative
public boolean isNegative() -
incrementExact
-
decrementExact
-
addExact
-