Date: Tue, 10 Jun 1997 00:55:22 +0930 (CST) From: Michael Smith <msmith@atrad.adelaide.edu.au> To: msmith@atrad.adelaide.edu.au (Michael Smith) Cc: hackers@FreeBSD.ORG Subject: Re: %i conversion in sscanf? Message-ID: <199706091525.AAA29286@genesis.atrad.adelaide.edu.au> In-Reply-To: <199706091452.AAA29091@genesis.atrad.adelaide.edu.au> from Michael Smith at "Jun 10, 97 00:22:20 am"
next in thread | previous in thread | raw e-mail | index | archive | help
Michael Smith stands accused of saying: > > 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 Oops, take that back one level. Tcl does _not_ think it's a good idea, it appears to think the same way as sscanf (because it uses it, dummy) silver:/tmp>tclsh % scan 0xABCDEF45 "%i" foo 1 % puts $foo 2147483647 % format "%x" $foo 7fffffff -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706091525.AAA29286>