Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jun 1997 15:32:58 -0230 (NDT)
From:      John Rochester <jr@cs.mun.ca>
To:        Michael Smith <msmith@atrad.adelaide.edu.au>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: %i conversion in sscanf?
Message-ID:  <Pine.OSF.3.91.970610152831.1032C-100000@garfield.cs.mun.ca>
In-Reply-To: <199706100002.JAA02000@genesis.atrad.adelaide.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 10 Jun 1997, Michael Smith wrote:
> Ollivier Robert stands accused of saying:
> > According to Michael Smith:
> > > It's "fairly" clear that %i might be expected to convert 0xABCDEF45
> > > to a negative number - Tcl thinks that way :
> > > 
> > > silver:/tmp>tclsh
> > > % expr 0xABCDEF45
> > > -1412567227
> > 
> > Interesting:
> > 
> > 244 [22:29] roberto@keltia:~> perl -e 'print 0xABCDEF45 . "\n"'
> > 2882400069
> > 
> > Perl 5.004 
> 
> Hmm.  What internal type does Perl use for numbers?  Or does it decide that 
> the constant is too big and use a bignum?

perl uses floating point.  double, I assume, but I don't know for sure.

-----
John Rochester			jr@cs.mun.ca
Dept. of Computer Science
Memorial University of Newfoundland, St. John's, Newfoundland, Canada



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.3.91.970610152831.1032C-100000>