unsigned integer?

Paul Rubin http
Sat Mar 10 14:26:08 EST 2007


"Jack" <nospam at invalid.com> writes:
> Also, if I have an int, I can convert it to unsigned int in C:
>    int i = -3;
>    int ui = (unsigned int)i;

I just tried it:

    main() {
      int i = -3;
      unsigned int ui = i;
      printf("%d\n", ui);
    }

prints -3.  What do you want the conversion to do?  If you want
the absolute value, use abs().



More information about the Python-list mailing list