
Matouš Jan FialkaandGitHub
c38876b46f
Space Lua: Improve numeric types semantics (#1803)
* Space Lua: Improve numeric types semantics
Add numeric result normalization for arithmetic operations:
* Integer operations preserve int type, collapse -0 to +0
* Float operations preserve float type, maintain -0.0
* Division always produces float results
Fix for-loop variable type tracking:
* Loop variable type determined by start/step parameters
* Integer loops produce integer variables
* Float/mixed loops produce float-tagged variables
Implement table key normalization:
* Integer-valued floats (1.0, 2.0) normalize to integer keys
* All zero variants (0, 0.0, -0.0) map to same key
* Non-integer floats (1.5) remain distinct keys
Add tests for:
* Arithmetic type preservation across operators
* For-loop type modes (int/float/mixed)
* Table key equivalence and normalization
* Edge cases with zero, -0.0, and special values
* Standard library `type` and `math.type`
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
* Code refactor and deduplication
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
---------
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2026-02-02 15:52:03 +01:00
..
2026-02-02 15:52:03 +01:00
2026-02-02 15:52:03 +01:00
2025-11-10 13:23:32 +01:00
2026-01-28 09:05:23 +01:00
2026-02-02 15:52:03 +01:00
2026-01-28 09:05:23 +01:00
2026-01-28 09:05:23 +01:00
2026-01-29 08:04:27 +01:00
2025-09-23 17:00:34 +02:00
2026-02-02 15:52:03 +01:00
2025-11-18 16:35:08 +01:00
2026-01-28 09:05:23 +01:00
2025-11-05 15:06:33 +01:00
2026-01-29 08:04:27 +01:00
2026-01-27 16:24:29 +01:00
2025-11-18 16:35:08 +01:00
2025-09-23 17:00:34 +02:00
2026-02-02 15:52:03 +01:00
2026-01-27 16:24:29 +01:00
2026-01-27 16:24:29 +01:00
2025-10-03 08:28:36 +02:00
2026-01-28 09:05:23 +01:00
2025-09-23 17:00:34 +02:00
2025-11-25 13:51:53 +01:00
2025-09-23 17:00:34 +02:00
2025-11-10 13:23:32 +01:00
2026-01-28 09:05:23 +01:00
2025-09-23 17:00:34 +02:00
2026-02-02 15:52:03 +01:00
2026-02-02 15:52:03 +01:00
2026-01-29 08:04:27 +01:00
2026-01-29 08:04:27 +01:00
2025-10-20 17:34:45 +02:00
2025-09-23 17:00:34 +02:00
2026-01-28 09:05:23 +01:00