Draft
This page is not complete.
Because JavaScript doesn't currently include standard support for 64-bit integer values, js-ctypes offers the Int64
and UInt64
objects to let you work with C functions and data that need (or may need) values represented using a 64-bit data type.
You use the Int64
object to create and manipulate 64-bit signed integers.
Int64
are not Int64
objects; rather, they're opaque objects whose values you manipulate through the other methods on the Int64
object. See 64-bit integers for details.Creates and returns a new 64-bit signed integer.
Int64 Int64( value );
value
Number
.A new object representing the specified value
.
TypeError
Number
, String
, or 64-bit integer object, or it's a string that is incorrectly formatted or contains a value outside the range that can be represented in 64 bits. This will also be thrown if the source value is a floating-point number that can't be precisely represented as a 64-bit integer.Number compare(a, b); |
Number hi(a); |
Int64 join(high, low); |
Number lo(a); |
String toSource(); |
String toString([radix]); |
Compares two 64-bit integer values.
Number compare( a, b );
a
b
The returned value is:
-1 if a
< b
,
0 if a
== b
, and
1 if a
> b
.
TypeError
Returns the high 32 bits of the specified value.
Number hi( num );
num
The high 32 bits of num
are returned. This is essentially num >> 32
.
TypeError
num
is not a 64-bit integer object.Returns the low 32 bits of the specified value.
Number lo( num );
num
Int64
value whose low 32 bits are to be returned.The low 32 bits of num
are returned. This is essentially num & 0xFFFFFFFF
.
TypeError
num
is not a 64-bit integer object.Creates a 64-bit integer object whose value is constructed using the specified high and low order 32-bit values.
Int64 join( high, low );
high
low
A new 64-bit integer object comprised of the two values merged together. The returned value is (high << 32) + low
.
TypeError
This method is for internal debugging use only.
Returns a string representation of the object's numeric value.
String toString( [radix] );
radix
OptionalA string representation of the value in the specified radix. This string consists of a leading minus sign, if the value was negative, followed by one or more lower-case digits in the specified radix.