
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
..
2025-09-23 17:00:34 +02:00
2026-01-31 16:54:48 +01:00
2026-01-21 11:01:11 +01:00
2026-01-27 17:12:27 +01:00
2025-09-19 13:23:20 +02:00
2026-01-31 17:07:35 +01:00
2025-09-19 13:23:20 +02:00
2026-01-15 09:27:14 +01:00
2026-01-30 08:22:48 +01:00
2026-01-30 08:33:32 +01:00
2026-01-30 08:22:48 +01:00
2026-01-29 15:14:53 +01:00
2026-02-02 15:52:03 +01:00
2026-01-29 15:14:53 +01:00
2026-02-02 11:53:43 +01:00
2025-10-22 15:35:37 +02:00
2025-09-19 13:23:20 +02:00
2026-01-07 11:00:32 +01:00
2026-01-29 11:07:28 +01:00
2026-01-20 13:48:15 +01:00
2026-01-29 14:30:11 +01:00
2025-10-31 09:13:24 +01:00
2025-10-31 09:13:24 +01:00
2025-10-30 15:35:34 +01:00
2025-11-28 14:40:05 +01:00
2026-01-09 15:30:34 +01:00
2026-01-15 11:14:16 +01:00
2025-09-19 13:23:20 +02:00
2025-09-23 17:00:34 +02:00
2025-09-19 13:23:20 +02:00
2025-09-19 13:23:20 +02:00
2025-09-29 15:30:38 +02:00
2025-11-07 10:46:14 +01:00
2025-11-07 10:46:14 +01:00
2026-01-27 10:33:45 +01:00
2025-09-23 17:00:34 +02:00
2026-01-20 13:48:15 +01:00
2026-01-30 08:22:48 +01:00
2026-01-30 08:22:48 +01:00
2025-10-10 08:42:25 +02:00