"Sputnik" help  
Sputnik Help
SizeBits(<sizeCode>)

Description

Calculates the number of bits based on the specified size code.

Parameters

<sizeCode> The size code that represents the target size.

Return Value

Success: Returns the number of bits for the specified size.
Failure: Returns null.

Remarks

The SizeBits function calculates the number of bits based on the specified size code. The size code is typically represented by constants such as @SizeCodeByte or @SizeCodeWord in Sputnik.

The internal implementation of the function multiplies the value 8ul (unsigned long) by shifting it to the left by the number of bits represented by the size code. This results in the total number of bits for the specified size.

Related

Example

Example of usage:

my $sizeCode = @SizeCodeByte;
my $mask = SizeBits($sizeCode);
say $mask;

my $sizeCode = @SizeCodeWord;
my $mask = SizeBits($sizeCode);
say $mask;

my $sizeCode = @SizeCodeDWord;
my $mask = SizeBits($sizeCode);
say $mask;

my $sizeCode = @SizeCodeQWord;
my $mask = SizeBits($sizeCode);
say $mask;

// PRINTS
// 8
// 16
// 32
// 64

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org