My God, sometimes I forget how lucky we are in Pythonland
Conversation
Notices
-
Embed this notice
Colin M. Ford (colinmford@typo.social)'s status on Saturday, 22-Apr-2023 04:24:42 JST Colin M. Ford
-
Embed this notice
Thomas 🔭✨ (thomasfuchs@hachyderm.io)'s status on Saturday, 22-Apr-2023 04:24:35 JST Thomas 🔭✨
@colinmford @villares otoh
`4 == 4.0000000000000001`
Is true in JavaScript, Python and Ruby. :)
-
Embed this notice
Thomas 🔭✨ (thomasfuchs@hachyderm.io)'s status on Saturday, 22-Apr-2023 05:48:33 JST Thomas 🔭✨
@villares @colinmford Very similar in Ruby. JavaScript doesn't have anything in the standard APIs/library last time I checked.
-
Embed this notice
Alexandre B A Villares 🐍 (villares@ciberlandia.pt)'s status on Saturday, 22-Apr-2023 05:48:34 JST Alexandre B A Villares 🐍
@thomasfuchs @colinmford yeah, you are quite right... floats are "hard". But then how about:
>>> from decimal import Decimal
>>> Decimal('4') == Decimal('4.0000000000000001')
False
-
Embed this notice