[BACK]Return to endian.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / pari-2.2 / config

File: [local] / OpenXM_contrib / pari-2.2 / config / Attic / endian.c (download)

Revision 1.1.1.1 (vendor branch), Tue Oct 2 11:16:55 2001 UTC (22 years, 8 months ago) by noro
Branch: NORO
CVS Tags: RELEASE_1_2_1, PARI_2_2
Changes since 1.1: +0 -0 lines

Imported pari-2.2.1(alpha).

main()
{
  int i;
  union
  {
    unsigned long l;
    char c[sizeof(long)];
  } u;

  if (sizeof(long) > 4) /* avoid "left shift count >= width of type" warning */
    u.l = (0x80706050UL << 28) | 0x04030201UL;
  else
    u.l = 0x04030201UL;
  for (i = 0; i < sizeof(long); i++)
    printf("%c", u.c[i]+'0');
  printf("\n");
  exit(0);
}