General Programming Discussion

8293 readers
2 users here now

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

Systems

Functional Programming

Also related

founded 6 years ago
MODERATORS
201
202
203
204
205
0
Grid World (alex.miller.garden)
submitted 2 years ago by yogthos@lemmy.ml to c/programming@lemmy.ml
206
207
208
209
210
211
212
213
214
215
 
 

r/programming comments

216
217
218
2
0.30000000000000004 (0.30000000000000004.com)
submitted 6 years ago by SourceCode@lemmy.ml to c/programming@lemmy.ml
 
 

Your language isn't broken, it's doing floating point math. Computers can only natively store integers, so they need some way of representing decimal numbers. This representation comes with some degree of inaccuracy. That's why, more often than not, .1 + .2 != .3.

219