goby
goby copied to clipboard
VM Float API Implementation
Referenced from the Ruby Ver. 2.4.1. Float data type API:
- [ ] Constant
Float::INFINITEstands for the number is infinite - [ ] Constant
Float::NANstands for "Not a Number"
~~Float#modulo Synonym to the % operator (Get the quotient from the divide operation)~~
~~Float#quo Synonym to the / operator (Get the quotient from the divide operation)~~
- [ ]
Float#absReturn positive number of the float. "Formally as the distance between 0 to the number of the float in 1-dimensional axis ..." - [ ]
Float#angle(andFloat#arg) If positive -> return 0; else -> return PI - [ ]
Float#ceilReturns smallest number greater than or equal to the receiver - [ ]
Float#floorReturns largest number smaller than or equal to the receiver - [ ]
Float#roundRounds float to a given precision in decimal digits (default 0 digits). Precision may be negative. Returns a floating point number whenndigits is more than zero. - [ ]
Float#finite?Returnstrueif receiver isn't equal toFloat::INFINITE - [ ]
Float#infinite?Returnstrueif receiver is equal toFloat::INFINITE - [ ]
Float#divmodReturns array which is in format of [ (Integer) Quotient, (Float) Remainder ] - [ ]
Float#nan?Returnstrueif receiver is equal toFloat::NAN - [ ]
Float#positive?Returnstrueif float number is larger than0.0 - [ ]
Float#negative?Returnstrueif float number is less than0.0 - [ ]
Float#zero?Returnstrueif float number is equal to0.0 - [ ]
Float#rationalizeConvert to something calledRationaldata type (Currently not supported but from my point of view, it is worth being addressed in this issue)
I think modulo and quo should not be implemented would conflict with Goby's policy of no duplicate methods - @st0012 ?
@saveriomiroddi @Maxwell-Alexius I have tested with some float numbers and seems like modulo and quo are really just alias methods. If so then we shouldn't support them.
Then in this case I will cross out those two methods, thanks for the feedback