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:
underscorediscovery
2016-10-31 19:52:32 +00:00
parent 8b9f99663b
commit a86e8158e4
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
System.print(3.log) // expect: 1.0986122886681
System.print(100.log) // expect: 4.6051701859881
System.print((-1).log) // expect: nan