Re: Rob printf problem.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Bernie Ryan writes:
> Run the following in "C" ( I used both Borland and MSC )
> #include <stdio.h>
> main() {
> printf("%d\n", -1);
> printf("%d\n", 0xffffffff);  // this returns -1
> }
> Then run the following in Euphoria
> printf(1,"%d\n", -1)
> printf(1,"%d\n", #FFFFFFFF)  -- this does not return -1

In Euphoria, hex numbers are positive unless
there's a minus sign in front.

You can "correct" the C code by using %u
(display an unsigned integer), instead of %d
(display a signed integer).

In Euphoria, you don't have to worry about
signed vs. unsigned integers. %d simply means
display an integer.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu