This article is in need of a technical review.
Draft
This page is not complete.
As JavaScript doesn't currently include standard support for 64bit integer values, jsctypes offers the Int64
and UInt64
objects to let you work with C functions and data that need (or may need) to use data represented using a 64bit data type.
You use the UInt64
object to create and manipulate 64bit unsigned integers.
UInt64
are not UInt64
objects; rather, they're opaque objects whose values you manipulate through the other methods on the UInt64
object. See 64bit integers for details.Method overview
JSUint64 UInt64(value); 
Number compare(a, b); 
Number hi(a); 
JSUint64 join(high, low); 
Number lo(a); 
String toSource([radix]); 
String toString(); 
Methods
UInt64()
Creates and returns a new 64bit unsigned integer.
JSUint64 UInt64( value );
Parameters

value

The value to assign the new 64bit unsigned integer object. This may be specified as an integer (if the value can be represented as a 32bit value), another 64bit integer object (either signed or unsigned), or as a string, which may consist of an optional minus sign, followed by either a decimal number or "0x" or "0X" followed by a hexadecimal number. The string is then converted into the corresponding 64bit integer value. You can therefore use a string to represent a 64bit value that is too large to represent as a 32bit JavaScript
Number
.
Return value
A new object representing the specified value
.
Exceptions thrown

TypeError

The specified value cannot be converted into a 64bit integer. Either it's not a
Number
,String
, or 64bit 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 floatingpoint number that can't be precisely represented as a 64bit integer.
compare()
Compares two 64bit integer values.
Number compare( a, b );
Parameters

a
 The first value to compare.

b
 The second value to compare.
Return value
The returned value is 1 if a
< b
, 0 if a
== b
, and 1 if a
> b
.
Exceptions thrown
 TypeError
 One or both of the specified values is not a 64bit integer (either signed or unsigned).
hi()
Returns the high 32 bits of the specified value.
Number hi( num );
Parameters

num
 The value whose high 32 bits are to be returned.
Return value
The high 32 bits of num
are returned. This is essentially num >> 32
.
Exceptions thrown

TypeError

num
is not a 64bit integer object.
lo()
Returns the low 32 bits of the specified value.
Number lo( num );
Parameters

num

The
Int64
value whose low 32 bits are to be returned.
Return value
The high 32 bits of num
are returned. This is essentially num & 0xFFFFFFFF
.
Exceptions thrown

TypeError

num
is not a 64bit integer object.
join()
Creates a 64bit integer object with a value constructed using the specified high and low order 32bit values.
Int64 join( high, low );
Parameters

high
 The highorder 32 bits of the value to create.

low
 The loworder 32 bits of the value to create.
Return value
A new 64bit integer object comprised of the two values merged together. The returned value is (high << 32) + low
.
Exceptions thrown

TypeError
 One or both of the specified numbers is not a JavaScript number with an integral value.
toSource()
This method is for internal debugging use only.
toString()
Returns a string representation of the object's numeric value.
String toString( [radix] );
Parameters

radix
Optional  The radix (base) to use when constructing the string. If you don't specify a radix, base 10 is used.
Return value
A 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 lowercase digits in the specified radix.