Re: Converting integer + mantissa to float

[email protected] (Rob Dixon)
Newsgroups perl.beginners
Message-ID <[email protected]>
Jay Savage wrote:
> 
> You're right, the mantissa may have leading zeros. Good catch. I need
> to keep them, though, or any later math will be off by multiple powers
> of ten. I'd completely missed that on the first go-around, but what I
> really need is
> 
> $x = sprinf "%u.%s", $int, $mantissa;

I think what you you really need is

  $x = sprintf "%s.%s", $int, $mantissa;

or really

  $x = "$int.$mantissa";

Get over it :)

Rob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.