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

ifloor, iceil, itrunc #3040

Closed
JeffBezanson opened this issue May 7, 2013 · 3 comments · Fixed by #9133
Closed

ifloor, iceil, itrunc #3040

JeffBezanson opened this issue May 7, 2013 · 3 comments · Fixed by #9133

Comments

@JeffBezanson
Copy link
Sponsor Member

iround now checks for out-of-range values, and allows a type argument to specify what to convert to. These features should be extended to ifloor, iceil, and itrunc.

@andrioni
Copy link
Member

andrioni commented May 7, 2013

I've just checked, and it seems that the typed iround for BigFloat has some issues, as it depends on int$(size)(BigInt), which isn't exactly great. What should be the behavior for iround(::T, x::BigFloat) when x is too big for T? typemax(T)? (and consequently to int$(size)(x::BigInt)).

@StefanKarpinski
Copy link
Sponsor Member

I think it needs to be an error.

andrioni added a commit to andrioni/julia that referenced this issue May 8, 2013
They convert to a Int64 if it fits, otherwise to BigInt.
JeffBezanson added a commit that referenced this issue May 9, 2013
…rt of #3040)

FloatingPoint->Int128 conversion (existing code mostly works for BigFloat too)
more BigFloat to int conversions
fix a couple other BigFloat issues
@quinnj
Copy link
Member

quinnj commented Jul 7, 2014

Bumping an old issue. It seems that itrunc, iceil, ifloor, allow a type as first argument. Not sure where to look about the out-of-range values. I can clean up anything else needed here.

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 a pull request may close this issue.

4 participants