Re: Converting integer + mantissa to float

2008-06-13 Thread Jay Savage
On Fri, Jun 13, 2008 at 1:19 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > 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-aroun

Re: Converting integer + mantissa to float

2008-06-13 Thread Rob Dixon
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;

Re: Converting integer + mantissa to float

2008-06-13 Thread Jay Savage
On Thu, Jun 12, 2008 at 4:45 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote: > "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 . '.' . $mat

Re: Converting integer + mantissa to float

2008-06-13 Thread Jay Savage
On Wed, Jun 11, 2008 at 2:19 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > Jay Savage wrote: >> >> I'm having trouble wrapping my brain around this: >> >> I am writing a script that will receive two integers as input that >> represent a single float. The first is the integer part, the second is >> hat

Re: Converting integer + mantissa to float

2008-06-12 Thread Dr.Ruud
"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(

Re: Converting integer + mantissa to float

2008-06-11 Thread Rob Dixon
Jay Savage wrote: > > I'm having trouble wrapping my brain around this: > > I am writing a script that will receive 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? all I'm > coming up wi

Converting integer + mantissa to float

2008-06-11 Thread Jay Savage
I'm having trouble wrapping my brain around this: I am writing a script that will receive 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? all I'm coming up with so far is: my $float = $int_