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

Removed iround, iceil, itrunc etc. #17

Closed
wants to merge 1 commit into from
Closed

Removed iround, iceil, itrunc etc. #17

wants to merge 1 commit into from

Conversation

pwl
Copy link
Contributor

@pwl pwl commented Nov 29, 2014

Hi, after pulling from Julia master ProfileView I started getting deprecation messages about iround and similar functions. Going down the rabbit hole I managed to fix it with this commit. The tests pass but I have no idea how FixedPointNumbers work so you should definitely check whether I didn't break anything.

EDIT: Tests fail for juliareleases, I guess this might be a problem.

ifloor(x::Ufixed) = ifloor(Int, x)
iceil(x::Ufixed) = iceil(Int, x)
trunc{T<:Integer}(::Type{T}, x::Ufixed) = convert(T, div(reinterpret(x), rawone(x)))
round{T<:Integer}(::Type{T}, x::Ufixed) = (@show T;round(T, reinterpret(x)/rawone(x)))
Copy link

Choose a reason for hiding this comment

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

Is this @show forgotten debug code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I missed it. Removed.

@ivarne
Copy link

ivarne commented Nov 30, 2014

FixedPointNumbers isn't a very active repo, so a fork for 0.3 might not be a big problem, but it is not an ideal situation.

@ivarne
Copy link

ivarne commented Nov 30, 2014

Compat.jl recently added functionality for this.

@timholy
Copy link
Member

timholy commented Dec 1, 2014

@pwl, all you need to do is add using Compat right after defining the FixedPointNumbers module, and this should be good to go.

@timholy
Copy link
Member

timholy commented Dec 1, 2014

Thanks, @pwl! I inadvertently caused you some trouble by merging another pending PR, so I went ahead and resolved the conflicts myself. Your commit is visible at https://github.com/JeffBezanson/FixedPointNumbers.jl/commits/master.

@timholy timholy closed this Dec 1, 2014
@pwl
Copy link
Contributor Author

pwl commented Dec 1, 2014

Thanks for resolving the conflicts. I tried to rebase but run into some problems with git due to my lack of experience with it.

@timholy
Copy link
Member

timholy commented Dec 1, 2014

New version tagged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants