feat: add natural logarithm method to Num class with C binding and test
Implement the `log` method on Num by adding a DEF_NUM_FN(log, log) macro invocation in wren_core.c, registering the corresponding primitive `num_log` on the numClass, and creating a new test file test/core/number/log.wren that validates positive and negative input behavior.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
System.print(3.log) // expect: 1.0986122886681
|
||||
System.print(100.log) // expect: 4.6051701859881
|
||||
System.print((-1).log) // expect: nan
|
||||
Reference in New Issue
Block a user