Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added PRECISION() macro definition

...

Code Block
bgColor#ccccff
langc
#include <assert.h>
#include <stdio.h>
#include <float.h>
#include <limits.h>

extern size_t popcount(uintmax_t);
#define PRECISION(umax_value) popcount(umax_value) 
int main(void) {
  assert(PRECISION(INT_MAX) <= DBL_MANT_DIG * log2(DBL_MANT_DIG));
  int big = 1234567890;
  double approx = big;
  printf("%d\n", (big - (int)approx));
  return 0;
}

...