"Sputnik" help  
Sputnik Help
HasPositiveSign(<value>, <sizeCode>)

Description

Checks whether a given unsigned integer has a positive sign.

Parameters

<value> The value to be checked.
<sizeCode> The size code indicating the size of the value. Use @SizeCodeDWord for 32-bit values and @SizeCodeQWord for 64-bit values.

Return Value

Success: Returns true.
Failure: Returns false.

Remarks

This function allows you to determine whether a given unsigned integer has a positive sign based on the size code provided. The function checks if the sign bit of the unsigned integer is set to zero, indicating a positive sign. It performs the check by bitwise ANDing the unsigned integer with the sign mask determined by the size code. If the result is zero, it means the sign bit is not set, and the function returns True, indicating a positive sign. Otherwise, it returns False.

Related

Example

Example of usage:

my $value = 777;
say HasPositiveSign((^UInt64)$value, @SizeCodeDWord);
my $value = -777;
say HasPositiveSign((^UInt64)$value, @SizeCodeDWord);

// PRINTS
// true
// false

 


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