Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM Float API Implementation #484

Open
15 tasks
Alexius-Huang opened this issue Oct 27, 2017 · 3 comments
Open
15 tasks

VM Float API Implementation #484

Alexius-Huang opened this issue Oct 27, 2017 · 3 comments
Assignees
Labels

Comments

@Alexius-Huang
Copy link
Member

Alexius-Huang commented Oct 27, 2017

Referenced from the Ruby Ver. 2.4.1. Float data type API:

  • Constant Float::INFINITE stands for the number is infinite
  • Constant Float::NAN stands 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#abs Return positive number of the float. "Formally as the distance between 0 to the number of the float in 1-dimensional axis ..."
  • Float#angle (and Float#arg) If positive -> return 0; else -> return PI
  • Float#ceil Returns smallest number greater than or equal to the receiver
  • Float#floor Returns largest number smaller than or equal to the receiver
  • Float#round Rounds float to a given precision in decimal digits (default 0 digits). Precision may be negative. Returns a floating point number when n digits is more than zero.
  • Float#finite? Returns true if receiver isn't equal to Float::INFINITE
  • Float#infinite? Returns true if receiver is equal to Float::INFINITE
  • Float#divmod Returns array which is in format of [ (Integer) Quotient, (Float) Remainder ]
  • Float#nan? Returns true if receiver is equal to Float::NAN
  • Float#positive? Returns true if float number is larger than 0.0
  • Float#negative? Returns true if float number is less than 0.0
  • Float#zero? Returns true if float number is equal to 0.0
  • Float#rationalize Convert to something called Rational data type (Currently not supported but from my point of view, it is worth being addressed in this issue)
@64kramsystem
Copy link
Member

I think modulo and quo should not be implemented would conflict with Goby's policy of no duplicate methods - @st0012 ?

@st0012
Copy link
Member

st0012 commented Oct 28, 2017

@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.

@Alexius-Huang
Copy link
Member Author

Then in this case I will cross out those two methods, thanks for the feedback

@st0012 st0012 added this to the version 0.1.8 milestone Jan 21, 2018
@st0012 st0012 modified the milestones: version 0.1.8, version 0.1.9 Mar 4, 2018
@SD10 SD10 mentioned this issue Mar 7, 2018
15 tasks
@st0012 st0012 modified the milestones: version 0.1.9, version 0.1.10 Apr 2, 2018
@st0012 st0012 mentioned this issue May 10, 2018
7 tasks
@ghost ghost assigned st0012 May 10, 2018
@ghost ghost added the in progress label May 10, 2018
@st0012 st0012 modified the milestones: version 0.1.10, version 0.1.11 Jun 10, 2018
@st0012 st0012 modified the milestones: version 0.1.11, version 0.1.12 Oct 13, 2019
@st0012 st0012 modified the milestones: version 0.1.12, version 0.1.13 Feb 16, 2020
@st0012 st0012 modified the milestones: version 0.1.13, version 0.1.14 Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants