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

Description

Converts a floating-point number to an unsigned integer based on the specified size code.

Parameters

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

Return Value

Success: Returns the unsigned integer equivalent to the input floating-point number, based on the specified size code.
Failure: Returns null.

Remarks

This function allows you to convert a floating-point number to an unsigned integer based on the size code provided. If the size code is @SizeCodeDWord, the function operates as FloatAsUInt32, converting a single-precision floating-point number to a 32-bit unsigned integer. If the size code is @SizeCodeQWord, the function operates as DoubleAsUInt64, converting a double-precision floating-point number to a 64-bit unsigned integer. This flexibility enables you to handle different sizes of floating-point numbers and perform the corresponding conversions.

Related

Example

Example of usage:

my $v = UIntAsFpu(777, @SizeCodeDWord);
say $v;
my $m = FpuAsUInt($v, @SizeCodeDWord);
say $m;

my $v = UIntAsFpu(777, @SizeCodeQWord);
say $v;
my $m = FpuAsUInt($v, @SizeCodeQWord);
say $m;

// PRINTS
// 1.08880890678038E-42
// 777
// 3.83889006818649E-321
// 777

 


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