...
| Code Block | ||||
|---|---|---|---|---|
| ||||
#include <stdio.h>
int main(void) {
long int big = 12345678901234567890L;
float approx = big;
printf("%ld\n", (big - (long int)approx));
return 0;
}
|
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
#include <assert.h>
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
extern size_t popcount(uintmax_t); /* See INT35-C */
#define PRECISION(umax_value) popcount(umax_value)
int main(void) {
assert(PRECISION(LONG_MAX) <= DBL_MANT_DIG * log2(FLT_RADIX));
long int big = 12345678901234567890L;
double approx = big;
printf("%ld\n", (big - (long int)approx));
return 0;
}
|
...