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

Description

Converts an unsigned integer to a floating-point number 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 floating-point number equivalent to the input unsigned integer, based on the specified size code.
Failure: Returns false.

Remarks

This function allows you to convert an unsigned integer to a floating-point number based on the size code provided. If the size code is @SizeCodeDWord, the function operates as UInt32AsFloat, converting a 32-bit integer to a single-precision floating-point number. If the size code is @SizeCodeQWord, the function operates as UInt64AsDouble, converting a 64-bit integer to a double-precision floating-point number. This flexibility enables you to handle different sizes of integers 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