feat: add Num.round method for rounding numbers to nearest integer

Implement the `round` method on the Num class that rounds a number to the nearest integer using standard rounding rules (away from zero for .5). The implementation adds a new `num_round` primitive function in the VM core, registers it as a method on the Num class, includes documentation in the core module reference, and adds a comprehensive test file covering positive, negative, zero, and fractional cases.
This commit is contained in:
Kyle Charters
2017-09-21 00:27:02 +00:00
parent c332ca35fd
commit 884e6853d3
4 changed files with 20 additions and 0 deletions
+1
View File
@@ -19,3 +19,4 @@ Will Speak <will@willspeak.me>
Damien Radtke <damienradtke@gmail.com>
Max Ferguson <maxxferguson@gmail.com>
Sven Bergström <sven@underscorediscovery.com>
Kyle Charters <kylewcharters@gmail.com>