Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |
| numeric [2025/02/27 13:06] – inverse, not xor. carl | numeric [2025/02/27 13:30] (current) – carl |
|---|
| As a consequence of their representation, most operations on numeric types are not true to their eponymous mathematical function. For example, adding two Int32 numbers can overflow, resulting in a wrong answer. Also, most floating point operations are not associative: (a + b) + c != a + (b + c). This is usually uncommon enough that it isn't a problem, but care should be taken to programming defensively. | As a consequence of their representation, most operations on numeric types are not true to their eponymous mathematical function. For example, adding two Int32 numbers can overflow, resulting in a wrong answer. Also, most floating point operations are not associative: (a + b) + c != a + (b + c). This is usually uncommon enough that it isn't a problem, but care should be taken to programming defensively. |
| |
| | |
| | |
| | ===== Support in Languages ===== |
| | |
| | ==== Java ==== |
| | Main: [[java:numeric|Java Numeric]]. |
| |