| ▲ | millipede 3 hours ago | |||||||
Both ints and floats represent real, rational values, but every operation in no way matches math. Associative? No. Commutative? No. Partially Ordered? No. Weakly Ordered? No. Symmetric? No. Reflexive? No. Antisymmetric? No. Nothing. The only reasonable way to compare rationals is the decimal expansion of the string. | ||||||||
| ▲ | layer8 8 minutes ago | parent | next [-] | |||||||
It’s not straightforward to compare numerical ordering using the decimal expansion. | ||||||||
| ▲ | tadfisher 2 hours ago | parent | prev | next [-] | |||||||
> The only reasonable way to compare rationals is the decimal expansion of the string. Careful, someone is liable to throw this in an LLM prompt and get back code expanding the ASCII characters for string values like "1/346". | ||||||||
| ▲ | threeducks 2 hours ago | parent | prev [-] | |||||||
What exactly do you say is not commutative? This Wikipedia article claims that at least floating-point addition and multiplication are both commutative: https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accu... | ||||||||
| ||||||||