[uClinux-dev] problem with big numbers continues... HELP!

Roope Anttinen roope.anttinen at indagon.com
Thu Mar 6 06:12:53 EST 2003


Hi,

this is really strange... I've got 500 pcs of uCdimm's waiting to be
deployed but this is a showstopper. I just have to use 64bit integer
there and here's the results I've got with uClinux-dist-20020927 and
m68k-elf-tools-20020410, with HAVE_LONG_LONG defined in uClibc/Config:

test.c:


#include <stdio.h>

int main(void)
{
  unsigned long long llInt = 83;
  printf("16: %llu\n", llInt<<16);
  printf("30: %llu\n", llInt<<30);
  printf("32: %llu\n", llInt<<32);
  llInt = 22022;
  if((83ll << 32) ==0) printf ("ZERO\n");
  else printf("NON ZERO\n");
  llInt += 38ll<<32;
  printf("foo: %llu\n", llInt);
  return 0;
}


# /mnt/test.gdb
16: 5439488
30: 3221225472
32: 0
NON ZERO
foo: 22022

and the same program compiled on my Linux workstation:

ranttine at tossu:~/src/module/module> ./test
16: 5439488
30: 89120571392
32: 356482285568
NON ZERO
foo: 163208779270






More information about the uClinux-dev mailing list