"Jay Savage" schreef:

> two integers as input that
> represent a single float. The first is the integer part, the second is
> hat mantissa. How do I recomine them into a single float?
>
> my $float = $int_part . '.' . $matissa; #or
> my $float = sprintf "%u.%u", $int_part, $mantissa;

The sprintf() makes me think that you receive the numbers, or at least
the mantissa, with possible leading zeroes.

I would add the venus operator:

my $float = 0+ sprintf("%u.%u", $int_part, $mantissa);

The $int_part is always non-negative?

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to