irelephant [he/him]@programming.devM to Software Gore@programming.devEnglish · 1 month agopretty small subtotal.programming.devimagemessage-square26fedilinkarrow-up1153arrow-down13
arrow-up1150arrow-down1imagepretty small subtotal.programming.devirelephant [he/him]@programming.devM to Software Gore@programming.devEnglish · 1 month agomessage-square26fedilink
minus-squareFizzyOrange@programming.devlinkfedilinkarrow-up1arrow-down1·1 month ago 0.1f64 + 0.2f64 != 0.3f64 It does if you round it to the nearest penny. Encoding in assumptions about a fixed amount of supported currencies in a system is broadly speaking not a good idea Most sensible programming languages allow enums to be non-exhaustive.
It does if you round it to the nearest penny.
Most sensible programming languages allow enums to be non-exhaustive.