Bugs

Sep. 21st, 2019 08:31 pm
izard: (Default)
[personal profile] izard
I just bought a big and expensive programming book at Powell's, from MIT Press, and in one of the first meaningful code sample, in the very beginning I read:

#define PI = 3.1592654

WTF!!! There are 2 bugs in this line, and I paid 80 bucks for the book!

Btw I am staying in Portland until next Sunday, so if you are around plz give me a shout..

Date: 2019-09-22 04:15 am (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
This is interesting.
Strangely, for many years I believed that FFP has some constants, including π... obviously, it was only in my implementation.

Date: 2019-09-22 04:29 am (UTC)
From: [personal profile] malobukov
Three bugs. You're supposed to #include <math.h> and use M_PI instead. If at some point in the future the value of π changes, you won't need to edit your code.

Date: 2019-09-22 05:15 am (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
It changes while the curvature of the Universe is decreasing. We'll collapse when it reaches e.

Date: 2019-09-22 07:37 am (UTC)
beldmit: (Программизм)
From: [personal profile] beldmit
Just 2 missing digits. 0,5% difference. Fits all the practical purposes!

Date: 2019-09-22 10:46 am (UTC)
norian: (Default)
From: [personal profile] norian
шо, бумажные книги ещё производят? надо же ..

Date: 2019-09-22 10:46 am (UTC)
fenikso: (Default)
From: [personal profile] fenikso
Please do not hesitate to mention the name of the book :)

Profile

izard: (Default)
izard

November 2025

S M T W T F S
       1
2345678
910 1112131415
1617 1819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 16th, 2026 12:57 pm
Powered by Dreamwidth Studios