-
Notifications
You must be signed in to change notification settings - Fork 171
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
Float class (backend) #443
Conversation
Codecov Report
@@ Coverage Diff @@
## master #443 +/- ##
==========================================
+ Coverage 82.55% 82.89% +0.34%
==========================================
Files 43 44 +1
Lines 7750 7946 +196
==========================================
+ Hits 6398 6587 +189
- Misses 1133 1141 +8
+ Partials 219 218 -1
Continue to review full report at Codecov.
|
57934b0
to
ead2771
Compare
Reference: Ruby strategy for cross-data type operations:
And (see https://silverhammermba.github.io/emberb/c/):
|
@st0012 should the equivalent of The implementation is easy, I'm wondering what's the rationale (purpose), since there is nothing equivalent in Ruby. |
c9d9f51
to
8df1d37
Compare
@saveriomiroddi The purpose for those methods is for calling Go functions. For current Integer class, those methods just change integer object's flag, and those flags only will be used when the integer is passed as Go function's parameters. But I think I'll change the implementation of this by letting methods like |
465516f
to
2620a64
Compare
@st0012 ready for review. |
Improved existing test cases; added new ones; aligned test values.
{`25 / 5`, 5}, | ||
{`1 / 1 + 1`, 2}, | ||
{`0 / (1 + 1000)`, 0}, | ||
{`5 ** (3 * 2) + 21`, 15646}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saveriomiroddi I want to keep these combined arithmetic operations test cases. Can you create another test function for these kind of tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Restored!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 😎
BTW thanks for reorganizing our integer tests at the same time 👍 |
Backend implementation of the Float class, without the frontend (parsing). At this stage, Floats are instantiated via
String#to_f
.Two related additions are made to the codebase:
Numeric
interface, common toFloat
andInteger
; currently it's only a lightweight, convenient, interface, not a full/visible Goby classtoBooleanObject()
, which replaces the boilerplate for converting Go boolean values to a Goby boolean ObjectThis PR closes the backend side of #379.