Follow

> Why do people use floats? Honest question. I don’t know any reason for using floats in any situation.

shit you read online

@hierarchon ah, people that have never needed a decimal number in their life

i would feel a kind of respect for that?

but most likely they just haven't been programming long, or have been doing it poorly

@pericynthion i think they do use decimal numbers, they just only use them in a case where you want exactness (money, etc)

@hierarchon ah yeah, in that case fixed point is very relevant, but floats still shouldn't be dismissed

and on the flip side people need to stop dismissing ints, how many fucking things have gone wrong because js doesn't have an int type and people are writing server software in it

@hierarchon Honestly even 15 years ago I was taught float had been effectively replaced by double "except on low-power devices like phones."

If you're using single-precision floating point for math, I sincerely hope it's either for intentional noise or for nothing critical.

@bluestarultor if you're doing machine learning stuff or anything that requires storing a *lot* of numbers, the space savings can be very worth it

@hierarchon I suppose in that instance yes, it does make sense.

Though I would also argue machine learning falls under benefitting from intentional noise and absolutely shouldn't be used for anything critical. One of Microsoft's own top minds just wrote a scathing book on the matter. "Artificial intelligence is neither" is a pretty quotable sound bite and I'm pretty sure I posted a very good interview with her recently that I could dig up if you're interested.

@bluestarultor I mean... I used to work on an ML system for a living, I'm well aware of its upsides and downsides.

@hierarchon Far more than me. I work financial. The amount of work I have to put into paring out all the error introduced by JavaScript treating every number as a float for our forms is a right pain, TBH. There are only 3 pieces of code in our entire core system that use floats and all of them are incredible specialty cases. I wrote two of them. Float and money are two things you never, ever want to combine. XD

Sign in to participate in the conversation
inherently digital

a very robotic single-user instance