Welcome, Guest. Please login or register.

Author Topic: 64 bit integers in SAS/C  (Read 12614 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1149
    • Show all replies
Re: 64 bit integers in SAS/C
« on: July 21, 2013, 07:05:22 PM »
Why bother? Thomas' solution works fine.
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1149
    • Show all replies
Re: 64 bit integers in SAS/C
« Reply #1 on: May 06, 2017, 10:57:27 PM »
VERY late, but here's disk size in bytes for greater than 32 bits using only 32 bit integers:

Code: [Select]
   unsigned int low;
    unsigned int high;

    low = info->id_NumBlocks % 100000;
    high = info->id_NumBlocks / 100000;

    low *= info->id_BytesPerBlock;
    high *= info->id_BytesPerBlock;

    high += low / 100000;
    low = low % 100000;

    printf("Size: %d%d bytes.\n", high, low);
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1149
    • Show all replies
Re: 64 bit integers in SAS/C
« Reply #2 on: May 07, 2017, 10:39:45 PM »
Quote from: psxphill;825467
The printf is wrong, because low isn't zero filled.
You're right, thanks. Don't know how I missed that.