r/badcode • • Mar 14 '21

c math has left the chat

Post image
4.7k Upvotes

94 comments sorted by

View all comments

244

u/EighthClubOfClubs Mar 14 '21

must be an engineer

0

u/[deleted] Mar 14 '21

[deleted] — view deleted comment

49

u/Kyn21kx Mar 15 '21

As an engineer, this does not represent me (I'd still happily just do 9.81 for g and 3.1416 for pi tho)

0

u/[deleted] Mar 15 '21

[deleted] — view deleted comment

6

u/lovemor Mar 15 '21

9,81 meters? Damn your highschool is fucked

35

u/[deleted] Mar 15 '21

Pi = 3.25... eh, factor of safety or something.

28

u/Kyn21kx Mar 15 '21

Ah, yes, the extra random factor, I'm way too familiar with that one

17

u/mrheosuper Mar 15 '21

2 digit after decimal is enough for me, so 3.14 it is

6

u/Kyn21kx Mar 15 '21

Yup, I mean, I can't personally complain too much about accuracy, since I use floating point numbers all the time

4

u/8asdqw731 Mar 15 '21

it's not the 80s anymore, time to convert to doubles

3

u/Kyn21kx Mar 15 '21

No thanks, I'm willing to accept floating point errors if it means improving performance and memory usage lol

4

u/Astrokiwi Mar 15 '21

Scientists are just like np.pi

8

u/gargar070402 Mar 15 '21

but, but e = pi = sqrt(g) = 3 ! Everyone knows that.

2

u/Random_182f2565 Mar 15 '21

Must be a journalist