-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add Math sqrt overloads for Bigs #5113
Conversation
src/big/math.cr
Outdated
@@ -0,0 +1,15 @@ | |||
require "big" | |||
|
|||
module Math |
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.
Please move this into Math
overloads at the end of each of the respective big_*.cr
files like here.
spec/std/math_spec.cr
Outdated
@@ -41,6 +42,18 @@ describe "Math" do | |||
Math.sqrt(4_f32).should eq(2) | |||
Math.sqrt(4).should eq(2) | |||
end | |||
|
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.
Maybe this should better be in the big* spec?
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.
@straight-shoota Idk, but spec for json+big and yaml+big are under json and yaml
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.
I think this is better in the big
specs.
spec/std/math_spec.cr
Outdated
@@ -1,4 +1,5 @@ | |||
require "spec" | |||
require "big" |
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.
You can remove this line now.
spec/std/math_spec.cr
Outdated
@@ -41,6 +42,18 @@ describe "Math" do | |||
Math.sqrt(4_f32).should eq(2) | |||
Math.sqrt(4).should eq(2) | |||
end | |||
|
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.
I think this is better in the big
specs.
All of the |
@asterite Currently, each |
This PR references #4792
It adds
Math#sqrt
overloads when werequire "big"