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

convert Rational to fmpq #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/flint/fmpq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,8 @@ convert(::Type{fmpq}, a::Integer) = fmpq(a)

convert(::Type{fmpq}, a::fmpz) = fmpq(a)

Base.convert(::Type{fmpq}, x::Rational) = fmpq(x.num, x.den)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does convert need the Base qualifier? We don't seem to have it on the previous line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. I did not find any import Base.convert.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our Base imports are in Nemo/src/Nemo.jl

On 13 September 2016 at 01:12, Jorge Fernández de Cossío Díaz <
[email protected]> wrote:

In src/flint/fmpq.jl
#62 (comment):

@@ -713,6 +713,8 @@ convert(::Type{fmpq}, a::Integer) = fmpq(a)

convert(::Type{fmpq}, a::fmpz) = fmpq(a)

+Base.convert(::Type{fmpq}, x::Rational) = fmpq(x.num, x.den)

I'm not sure. I did not find any import Base.convert.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/wbhart/Nemo.jl/pull/62/files/25c9cb65f332a4f014fa3a04a8938d85ab7198e7#r78471874,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAOzpnQD48yM5YJdsV1jhffxQYQicgFiks5qpdxagaJpZM4J6u5P
.


Base.promote_rule{T <: Integer}(::Type{fmpq}, ::Type{T}) = fmpq

Base.promote_rule(::Type{fmpq}, ::Type{fmpz}) = fmpq
Expand Down