feat: implement modulo operator for numbers with fmod and add test suite
Add num_mod primitive using fmod from math.h to support the % operator on number types. Register the new primitive in the numClass method table. Include a comprehensive test file covering positive, negative, and left-associative modulo cases, plus a divide-by-zero TODO comment in the existing division test.
This commit is contained in:
@@ -2,3 +2,4 @@ io.write(8 / 2) // expect: 4
|
||||
|
||||
// TODO(bob): Floating point numbers.
|
||||
// TODO(bob): Unsupported RHS types.
|
||||
// TODO(bob): Divide by zero.
|
||||
|
||||
Reference in New Issue
Block a user