@djlink the first time as a junior dev you accidentally do a f == f comparison

@worthlessbums
@djlink

Getting burned with floating points early, having a strict policy of using decimal arithmetic only for all decimal numbers for decades, eventually forgetting why, become convinced that you'll never encounter it in the wild using the types of values you're actually using...

Then you assert(m >= ceil(n * 1.1)) and it all comes flooding back.

@djlink …unless you're writing #JavaScript or #TypeScript

But hey! then you're fucked from the start!

@djlink

"If you have to ask 'do I need a floating point variable?' the answer is always 'no'".

cc @arisunz

@angelastella 💯

iba a decir que usarlo para representar género sería aceptable, pero creo que para eso prefiero una matriz de n-dimensiones /hj

also le pifiaste a la cuenta, esa la vuelo hoy (y si, es 100% culpa mia por estar haciendo cagadas con subdominios ajajaj)

@arisunz

Las matrices n-dimensionales sirven para todo, hoy en día la memoria es barata (?)

Mencioné la cuenta que usaste para el boost, jajaja.

@angelastella wait what, pero en la otra cuenta no me aparece que haya boosteado ese post

oh god oh fuck

@arisunz

Con calma. Si precisás que mire algo desde "afuera" (desde mi instancia, o sea), acá estoy.

@djlink

looks like a horror movie poster lol

@hyeyoo

The horror version of this would say

"They thought they could trust a floating point comparison"

@djlink

@djlink errm I would actually trust a < or >
@djlink obviously not an equality but if I needed to for one I would check for it within a range
if equalities are important I would probably just use a fixed point

@ivy @djlink Also depends on the context. If you're dealing with things that must be a power-of-two fraction (ex: 0.5, 0.25, 0.125) then it might make sense to compare... although might be time to question why floating points are being used.

But, yes, most scenarios is less than a delta from the expected value.

@djlink I trust a>b because the floating point finite field for all IEEE formats is well ordered.
I also trust a==b when performing non-transformative confirmation of pedigree.
</spoiling-the-joke>

@djlink Cries in JavaScript.

Everything is floating point here🫠

@djlink Tell that to 99% of Excel users.
@djlink I like to live dangerously
@djlink you wouldnt download a NaN !
@djlink @Mattmos when I teach rust people just do not get why we have both Eq and PartialEq traits. The world is messy and we’re making you deal with it up front. Much better than finding out the hard way later.
If not for IEEE 754 floating-point compliance, I'd argue we should have just made NaN == NaN and had that be the end of it. (Or, alternatively, have NaN produce an exception like 1/0 by default.) That's a more understandable, less confusing, and in my opinion less error-prone system.

(Whether and how to *sort* NaN so that floats can be Ord is a harder and more debatable question.)
@josh @djlink maybe, but sadly IEEE-754 exists and we couldn’t not follow it
@djlink Don't Fear The Float!
I have messed around with floats long enough to fear them.

CC: @[email protected]
@djlink Reminds me of when I made that mistake in my very first ray tracer (that lump of noise in the middle was supposed to be refraction) :P