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

Add Math sqrt overloads for Bigs #5113

Merged
merged 4 commits into from Oct 14, 2017
Merged

Conversation

iSarCasm
Copy link
Contributor

This PR references #4792

It adds Math#sqrt overloads when we require "big"

src/big/math.cr Outdated
@@ -0,0 +1,15 @@
require "big"

module Math
Copy link
Contributor

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.

@@ -41,6 +42,18 @@ describe "Math" do
Math.sqrt(4_f32).should eq(2)
Math.sqrt(4).should eq(2)
end

Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Contributor

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.

@@ -1,4 +1,5 @@
require "spec"
require "big"
Copy link
Contributor

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.

@@ -41,6 +42,18 @@ describe "Math" do
Math.sqrt(4_f32).should eq(2)
Math.sqrt(4).should eq(2)
end

Copy link
Contributor

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.

@asterite
Copy link
Member

All of the Big* types are kind of related, so it doesn't matter where things are defined, all Big* types should be requiredd in one go with require "big". We should remove/hide those big/big_float.

@iSarCasm
Copy link
Contributor Author

@asterite not quite sure I got what you meant. @RX14 does it look better now?

@RX14
Copy link
Contributor

RX14 commented Oct 14, 2017

@asterite Currently, each BigFoo type can be required individually. If you want to clean up the code and make it so that isn't possible go ahead but thats outside the scope of this PR.

RX14
RX14 approved these changes Oct 14, 2017
@RX14 RX14 added this to the Next milestone Oct 14, 2017
@RX14 RX14 removed this from the Next milestone Oct 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants