1. Jesus and his HEX Number Problem {Rob??}
- Posted by Hawke <mdeland at NWINFO.NET> Jul 03, 1998
- 493 views
after reading jesus' last post about hexadecimal constants, i thought he might be using %f in printf and i also wondered what would happen if instead of using 'constant' that he defined his constants as 'integers' and assigned them values and so i whipped up the following: ------------------------------- constant testnum = #FFFFFFFF integer testnum2 testnum2 = #FFFFFFFF printf(1, "%d\n",testnum) printf(1, "%d\n",testnum2) ------------------------------- here is the output: ------------------------------- C:\blah>ex test test.ex:3 type_check failure, testnum2 is 4.29497e+009 --> see ex.err C:\blah>type ex.err test.ex:3 type_check failure, testnum2 is 4.29497e+009 Global & Local Variables test.ex: testnum2 = 4.29497e+009 ------------------------------- ummmmm hello? ummmm testnum2 is *declared* to be *integer*.... are Jesus and I both screwed up? or... well i don't wanna think about the or... anyone? <Stumped>Hawke'</Stumped>
2. Re: Jesus and his HEX Number Problem {Rob??}
- Posted by =?iso-8859-1?Q?JesusC_-_Jes=FAs_Consuegra?= Jul 03, 1998
- 470 views
Hawke said: >i thought he might be using %f in printf Not, just ? at the degugger window >and i also wondered what would happen if instead of using 'constant' >that he defined his constants as 'integers' and assigned >them values That should be the next step, but you answered so fast that your test saved me of trying it. >are Jesus and I both screwed up? >or... well i don't wanna think about the or... Me neither. For the sake of continuity, I've just put constant INADDR_NONE = -1 -- #FFFFFFFF and everything works fine... That's what we call in Spanish "una chapuza". I don't know the word in english, but is what I use to do when a water pipe breaks on saturday, I have no tools, and nobody wants to come to fix it until monday... (just wrap something around the pipe and firmly place on site with plastic strips...) Why not to have qualified constants like "integer constant INADDR_NONE = #FFFFFFFF"???? (Just another suggestion for the box). Jesus-winsoking-properly
3. Jesus and his HEX Number Problem {Rob??}
- Posted by Alan Tu <ATU5713 at COMPUSERVE.COM> Jul 03, 1998
- 475 views
All right. I think I isolated one problem. The thing must be declared a= s an atom. Library.doc says that %d prints "an atom". But, new problem. Why doesn't this work? atom test test =3D 49 printf(1,%d,test) --Alan ------------------------------------------------- Visit my web page at: http://ourworld.compuserve.com/homepages/atu5713/ =
4. Re: Jesus and his HEX Number Problem {Rob??}
- Posted by Irv <irv at ELLIJAY.COM> Jul 03, 1998
- 480 views
Alan Tu wrote: > > All right. I think I isolated one problem. The thing must be declared as > an atom. > > Library.doc says that %d prints "an atom". > > But, new problem. Why doesn't this work? > > atom test > test = 49 > printf(1,%d,test) > printf(1,"%d",test) -- works better. Regards, Irv > Visit my web page at: > http://ourworld.compuserve.com/homepages/atu5713/ > >
5. Re: Jesus and his HEX Number Problem {Rob??}
- Posted by Terry Constant <constant at FLASH.NET> Jul 03, 1998
- 481 views
On Fri, 3 Jul 1998 04:18:14 -0700, Hawke <mdeland at NWINFO.NET> wrote: >------------------------------- >constant testnum = #FFFFFFFF >integer testnum2 >testnum2 = #FFFFFFFF >printf(1, "%d\n",testnum) >printf(1, "%d\n",testnum2) >------------------------------- > ><Stumped>Hawke'</Stumped> According to Refman.doc, and I quote: "type integer must be atoms with integer values from -1073741824 to +1073741823 inclusive." Thus, the largest value testnum2 can be is: testnum2 = #3FFFFFFF Hope this clarification helps. Obviously, this limitation is related to the attempt to use #FFFFFFFF as equivalent to -1. Terry Constant constant at flash.net