Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Wildcard Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Bin64 Source Code
 previous   up   next 

Types
bin64
Binary values with 64 bits.

bin64

const type: bin64

Binary values with 64 bits. This type is intended for bit operations that are not defined for integer values. The internal representation is the same as for integer.


Operator Summary
integer
(attr integer) conv (in bin64: binValue)
Convert to integer.
bin64
(attr bin64) conv (in integer: anInt)
Convert to bin64.
string
(in bin64: number) radix (in integer: base)
Convert a bin64 value to a string using a radix.
string
(in bin64: number) RADIX (in integer: base)
Convert a bin64 value to a string using a radix.
boolean
(in bin64: binary1) = (in bin64: binary2)
Check if two bin64 values are equal.
boolean
(in bin64: binary1) <> (in bin64: binary2)
Check if two bin64 values are not equal.
bin64
(in bin64: binary1) & (in bin64: binary2)
Compute a bitwise and of two bin64 values.
bin64
(in bin64: binary1) | (in bin64: binary2)
Compute a bitwise inclusive or of two bin64 values.
bin64
(in bin64: binary1) >< (in bin64: binary2)
Compute a bitwise exclusive or (xor) of two bin64 values.
bin64
~ (in bin64: aBinary)
Compute a bitwise not of a bin64 value.
bin64
(in bin64: binValue) << (in integer: lshift)
Shift a bin64 value left by lshift bits.
bin64
(in bin64: binValue) >> (in integer: lshift)
Shift a bin64 value right by rshift bits.
void
(inout bin64: binValue) <<:= (in integer: lshift)
Shift a bin64 value left by lshift bits and assign the result back to binValue.
void
(inout bin64: binValue) >>:= (in integer: rshift)
Shift a bin64 value right by rshift bits and assign the result back to binValue.
void
(inout bin64: binary1) &:= (in bin64: binary2)
Compute a bitwise and and assign the result back to binary1.
void
(inout bin64: binary1) |:= (in bin64: binary2)
Compute a bitwise inclusive or and assign the result back to binary1.
void
(inout bin64: binary1) ><:= (in bin64: binary2)
Compute a bitwise exclusive or (xor) and assign the result back to binary1.

Function Summary
integer
ord (in bin64: binValue)
Convert to integer.
bin64
bin64 (in integer: number)
Convert to bin64.
bigInteger
big (in bin64: binValue)
Convert to bigInteger.
bin64
bin64 (in bigInteger: number)
Convert to bin64.
bin64
bin64 (in char: ch)
Convert to bin64.
bin64
bin64 (in float: number)
Convert to bin64.
float
float (in bin64: bits)
Convert to float.
integer
compare (in bin64: number1, in bin64: number2)
Compare two bin64 values.
integer
hashCode (in bin64: number)
Compute the hash value of a bin64 value.
bin64
rand (attr bin64)
Compute pseudo-random bin64 value.
string
str (in bin64: number)
Convert an bin64 value to a string.
bin64
rotLeft (in bin64: x, in integer: shiftCount)
Rotate the bits of a bin64 value left by shiftCount bits.
bin64
rotRight (in bin64: x, in integer: shiftCount)
Rotate the bits of a bin64 value right by shiftCount bits.
bin64
getBinary (in bitset: set1, in integer: lowestBitNum)
Get 64 bits from a bitset starting with lowestBitNum.
bin64
float2Bits (in float: number, DOUBLE)
Get bits in IEEE 754 double-precision representation from a float.
float
bits2Float (in bin64: bits)
Get a float from bits in IEEE 754 double-precision representation.
bin64
float2MbfBits (in float: number, DOUBLE)
Get bits in MBF double-precision representation from a float.
float
mbfBits2Float (in bin64: bits)
Get a float from bits in MBF double-precision representation.
bin64
bin64 (in string: eightBytes, LE)
Convert a string of eight little-endian bytes to a bin64 value.
bin64
bin64 (in string: eightBytes, BE)
Convert a string of eight big-endian bytes to a bin64 value.
string
bin64AsEightBytesLe (in bin64: binValue)
Convert 64 lower bits of a bin64 value into eight little-endian chars.
string
bin64AsEightBytesBe (in bin64: binValue)
Convert 64 lower bits of a bin64 value into eight big-endian chars.

Operator Detail

conv

const func integer: (attr integer) conv (in bin64: binValue)

Convert to integer.

Returns:
the unchanged value as integer.

conv

const func bin64: (attr bin64) conv (in integer: anInt)

Convert to bin64.

Returns:
the unchanged value as bin64.

radix

const func string: (in bin64: number) radix (in integer: base)

Convert a bin64 value to a string using a radix. The conversion uses the numeral system with the given base. Digit values from 10 upward are encoded with lower case letters. E.g.: 10 is encoded with a, 11 with b, etc.

Returns:
the string result of the conversion.
Raises:
RANGE_ERROR - When base < 2 or base > 36 holds.
MEMORY_ERROR - Not enough memory to represent the result.

RADIX

const func string: (in bin64: number) RADIX (in integer: base)

Convert a bin64 value to a string using a radix. The conversion uses the numeral system with the given base. Digit values from 10 upward are encoded with upper case letters. E.g.: 10 is encoded with A, 11 with B, etc.

Returns:
the string result of the conversion.
Raises:
RANGE_ERROR - When base < 2 or base > 36 holds.
MEMORY_ERROR - Not enough memory to represent the result.

=

const func boolean: (in bin64: binary1) = (in bin64: binary2)

Check if two bin64 values are equal.

Returns:
TRUE if the two values are equal, FALSE otherwise.

<>

const func boolean: (in bin64: binary1) <> (in bin64: binary2)

Check if two bin64 values are not equal.

Returns:
FALSE if both values are equal, TRUE otherwise.

&

const func bin64: (in bin64: binary1) & (in bin64: binary2)

Compute a bitwise and of two bin64 values.

Returns:
the bitwise and of the two values.

|

const func bin64: (in bin64: binary1) | (in bin64: binary2)

Compute a bitwise inclusive or of two bin64 values.

Returns:
the bitwise inclusive or of the two values.

><

const func bin64: (in bin64: binary1) >< (in bin64: binary2)

Compute a bitwise exclusive or (xor) of two bin64 values.

Returns:
the bitwise xor of the two values.

~

const func bin64: ~ (in bin64: aBinary)

Compute a bitwise not of a bin64 value.

Returns:
the bitwise not of the value.

<<

const func bin64: (in bin64: binValue) << (in integer: lshift)

Shift a bin64 value left by lshift bits. Bits shifted beyond the highest bit position are lost.

Returns:
the left shifted value.
Raises:
OVERFLOW_ERROR - When the shift amount is negative or greater equal 64.

>>

const func bin64: (in bin64: binValue) >> (in integer: lshift)

Shift a bin64 value right by rshift bits. Bits shifted beyond the lowest bit position are lost.

Returns:
the right shifted value.
Raises:
OVERFLOW_ERROR - When the shift amount is negative or greater equal 64.

<<:=

const proc: (inout bin64: binValue) <<:= (in integer: lshift)

Shift a bin64 value left by lshift bits and assign the result back to binValue. Bits shifted beyond the highest bit position are lost.

Raises:
OVERFLOW_ERROR - When the shift amount is negative or greater equal 64.

>>:=

const proc: (inout bin64: binValue) >>:= (in integer: rshift)

Shift a bin64 value right by rshift bits and assign the result back to binValue. Bits shifted beyond the lowest bit position are lost.

Raises:
OVERFLOW_ERROR - When the shift amount is negative or greater equal 64.

&:=

const proc: (inout bin64: binary1) &:= (in bin64: binary2)

Compute a bitwise and and assign the result back to binary1.


|:=

const proc: (inout bin64: binary1) |:= (in bin64: binary2)

Compute a bitwise inclusive or and assign the result back to binary1.


><:=

const proc: (inout bin64: binary1) ><:= (in bin64: binary2)

Compute a bitwise exclusive or (xor) and assign the result back to binary1.


Function Detail

ord

const func integer: ord (in bin64: binValue)

Convert to integer.

Returns:
the unchanged value as integer.

bin64

const func bin64: bin64 (in integer: number)

Convert to bin64.

Returns:
the unchanged value as bin64.

big

const func bigInteger: big (in bin64: binValue)

Convert to bigInteger.

Returns:
the unchanged value as integer.

bin64

const func bin64: bin64 (in bigInteger: number)

Convert to bin64.

Returns:
the unchanged value as bin64.

bin64

const func bin64: bin64 (in char: ch)

Convert to bin64.

Returns:
the unchanged value as bin64.

bin64

const func bin64: bin64 (in float: number)

Convert to bin64. Get bits in IEEE 754 double-precision representation from a float.

Parameters:
number - Float value to be converted to bin64.
Returns:
64 bits in IEEE 754 double-precision float representation.

float

const func float: float (in bin64: bits)

Convert to float. Get a float from bits in IEEE 754 double-precision representation.

Parameters:
bits - Bits to be converted to a float.
Returns:
a float from bits in double-precision float representation.

compare

const func integer: compare (in bin64: number1, in bin64: number2)

Compare two bin64 values.

Returns:
-1, 0 or 1 if the first argument is considered to be respectively less than, equal to, or greater than the second.

hashCode

const func integer: hashCode (in bin64: number)

Compute the hash value of a bin64 value.

Returns:
the hash value.

rand

const func bin64: rand (attr bin64)

Compute pseudo-random bin64 value. The random values are uniform distributed.

Returns:
a random bin64 value.

str

const func string: str (in bin64: number)

Convert an bin64 value to a string. The values is converted to a string with decimal representation.

Returns:
the string result of the conversion.
Raises:
MEMORY_ERROR - Not enough memory to represent the result.

rotLeft

const func bin64: rotLeft (in bin64: x, in integer: shiftCount)

Rotate the bits of a bin64 value left by shiftCount bits. The vacant bit positions at the right side are filled in with the bits that are shifted out at the left side.

Returns:
the left rotated value.
Raises:
OVERFLOW_ERROR - When the shift amount is negative or greater than 64.

rotRight

const func bin64: rotRight (in bin64: x, in integer: shiftCount)

Rotate the bits of a bin64 value right by shiftCount bits. The vacant bit positions at the left side are filled in with the bits that are shifted out at the right side.

Returns:
the right rotated value.
Raises:
OVERFLOW_ERROR - When the shift amount is negative or greater than 64.

getBinary

const func bin64: getBinary (in bitset: set1, in integer: lowestBitNum)

Get 64 bits from a bitset starting with lowestBitNum.


float2Bits

const func bin64: float2Bits (in float: number, DOUBLE)

Get bits in IEEE 754 double-precision representation from a float.

Parameters:
number - Float value to be converted to bin64.
Returns:
64 bits in IEEE 754 double-precision float representation.

bits2Float

const func float: bits2Float (in bin64: bits)

Get a float from bits in IEEE 754 double-precision representation.

Parameters:
bits - Bits to be converted to a float.
Returns:
a float from bits in double-precision float representation.

float2MbfBits

const func bin64: float2MbfBits (in float: number, DOUBLE)

Get bits in MBF double-precision representation from a float. Microsoft Binary Format (MBF) is a format for floating point numbers. The double-precision version of MBF has a 8 bit exponent, a sign bit and a 55 bit mantissa.

Parameters:
number - Float value to be converted to bin64.
Returns:
64 bits in MBF double-precision float representation.
Raises:
RANGE_ERROR - When number is not representable in MBF. NaN, Infinity and -Infinity are not representable in MBF. Numbers with an absolut value larger than 1.7014118346046921e+38 are also not representable in MBF.

mbfBits2Float

const func float: mbfBits2Float (in bin64: bits)

Get a float from bits in MBF double-precision representation. Microsoft Binary Format (MBF) is a format for floating point numbers. The double-precision version of MBF has a 8 bit exponent, a sign bit and a 55 bit mantissa.

Parameters:
bits - Bits to be converted to a float.
Returns:
a float from bits in double-precision float representation.

bin64

const func bin64: bin64 (in string: eightBytes, LE)

Convert a string of eight little-endian bytes to a bin64 value.

Returns:
the bin64 value.

bin64

const func bin64: bin64 (in string: eightBytes, BE)

Convert a string of eight big-endian bytes to a bin64 value.

Returns:
the bin64 value.

bin64AsEightBytesLe

const func string: bin64AsEightBytesLe (in bin64: binValue)

Convert 64 lower bits of a bin64 value into eight little-endian chars.

Returns:
a string of length eight with the little-endian representation.

bin64AsEightBytesBe

const func string: bin64AsEightBytesBe (in bin64: binValue)

Convert 64 lower bits of a bin64 value into eight big-endian chars.

Returns:
a string of length eight with the big-endian representation.


 previous   up   next