tfm@europe.pub to Programmer Humor@lemmy.mlEnglish · 3 months agoPython!europe.pubimagemessage-square17linkfedilinkarrow-up10arrow-down10
arrow-up10arrow-down1imagePython!europe.pubtfm@europe.pub to Programmer Humor@lemmy.mlEnglish · 3 months agomessage-square17linkfedilink
minus-squareCevilia (she/they/…)@lemmy.blahaj.zonelinkfedilinkEnglisharrow-up0·3 months agoAh, Python. It might not be fast, but it gets it right in the end. :)
minus-squareOriel Jutty :hhHHHAAAH:@infosec.exchangecakelinkfedilinkarrow-up0·3 months ago$ python3 -c 'f = (lambda x: x + 0.5 - 0.5); print(f(2**52))' 4503599627370495.5 #python
minus-squareCevilia (she/they/…)@lemmy.blahaj.zonelinkfedilinkEnglisharrow-up0·3 months agoAhh, contrived examples of floating point errors. I haven’t seen those since I asked Javascript to add 0.1 and 0.2 :)
Ah, Python. It might not be fast, but it gets it right in the end. :)
$ python3 -c 'f = (lambda x: x + 0.5 - 0.5); print(f(2**52))' 4503599627370495.5#python
Ahh, contrived examples of floating point errors. I haven’t seen those since I asked Javascript to add 0.1 and 0.2 :)