0.30000000000000004.com

``` % js Welcome to Node.js v12.18.4. Type ".help" for more information.

0.1 + 0.2 0.30000000000000004 ```

% irb irb(main):001:0> 0.1+0.2 0.30000000000000004

``` % js Welcome to Node.js v12.18.4. Type ".help" for more information.

10 / 3 / 4 / 5 0.16666666666666669 10 / 5 / 4 / 3 0.16666666666666666 ```

% irb irb(main):001:0> (p 10.0 / 3 / 4 / 5) == (p 10 / 5 / 4 / 3) 0.16666666666666669 0 false

``` c arithm.c

include

include

void print_float(float f) { char d = (char)&f; printf("0x%2x%2x%2x%2x\n", d[3] & 0xFF, d[2] & 0xFF, d[1] & 0xFF, d[0] & 0xFF); }

int main(void) { printf("%0.17f\n", 0.1 + 0.2); printf("%0.17f\n", 10.0 / 3 / 4 / 5); printf("%0.17f\n", 10.0 / 5 / 4 / 3);

print_float(0.1f);
print_float(0.2f);
print_float(0.3f);

return EXIT_SUCCESS;

} ```

console % ./arithm 0.30000000000000004 0.16666666666666669 0.16666666666666666 0x3dcccccd 0x3e4ccccd 0x3e99999a