Re: Numeranomalies

2002-02-13 Thread Stephen Patterson
On 11 Feb 02, Ember Normand ([EMAIL PROTECTED]) wrote: > I'm very interested to hear what else the perl porters list will say, > because it looks like the only way to get the error is the original example. > > ($num1 % 1000) * 16777216; > > ie: (var_any_number % literal_numerical_constan

RE: Numeranomalies

2002-02-09 Thread Carl Jolley
On Fri, 8 Feb 2002, Joe Schell wrote: > > > > -Original Message- > > From: Carl Jolley [mailto:[EMAIL PROTECTED]] > > > > > > > > > > Your (1) above is more complex. The error occurs in the > > following range > > > > > > > > > >2^31-1 to 2^32-1 > > > > > > > > > > Where 2^32 works c

RE: Numeranomalies

2002-02-09 Thread Carl Jolley
On Fri, 8 Feb 2002, Joe Schell wrote: > > > > -Original Message- > > From: Carl Jolley [mailto:[EMAIL PROTECTED]] > > > > > > > > > > Your (1) above is more complex. The error occurs in the > > following range > > > > > > > > > >2^31-1 to 2^32-1 > > > > > > > > > > Where 2^32 works c

Re: Numeranomalies

2002-02-09 Thread Sisyphus
- Original Message - From: "John Draper" <[EMAIL PROTECTED]> > I don't know if it helps to resolve anything, but writing the literal > constant: > "167772160" > in the form: > "16777216.0E1;" > > i.e., in scientific notation, and thus forcing it into floating point mode, > yiel

Re: Numeranomalies

2002-02-09 Thread John Draper
I don't know if it helps to resolve anything, but writing the literal constant: "167772160" in the form: "16777216.0E1;" i.e., in scientific notation, and thus forcing it into floating point mode, yields the correct results: # my $base = 167772160; # n

RE: Numeranomalies

2002-02-08 Thread Joe Schell
> -Original Message- > Behalf Of Sisyphus > > > > - Original Message - > From: "Joe Schell" <[EMAIL PROTECTED]> > > > > Ok - so it seems that there are 3 ingredients that must be present for > the > > > problem to arise: > > > 1) Big numbers - beyond 2^31-1. > > > 2) The '%' ope

Re: Numeranomalies

2002-02-08 Thread Sisyphus
- Original Message - From: "Joe Schell" <[EMAIL PROTECTED]> > > Ok - so it seems that there are 3 ingredients that must be present for the > > problem to arise: > > 1) Big numbers - beyond 2^31-1. > > 2) The '%' operator. > > 3) A 'bare number' (for want of a better term). > > > > If an

Re: Numeranomalies

2002-02-06 Thread Sisyphus
- Original Message - From: "Joe Schell" <[EMAIL PROTECTED]> > > First the case can be reduced. > > my $base = 16777216; > my $result; > > my $num1 = 1219; > my $num2 = 219; > my $num3 = 218; > > > $result = ($num1 % 1000) * 16777216; > print "number1 = $result\n"; > $result = ($num3 + 1)