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

Euclidean division of Inf returns NaN #26694

Open
wsshin opened this issue Apr 4, 2018 · 2 comments
Open

Euclidean division of Inf returns NaN #26694

wsshin opened this issue Apr 4, 2018 · 2 comments
Labels
domain:maths Mathematical functions

Comments

@wsshin
Copy link
Contributor

wsshin commented Apr 4, 2018

I think fld(a, b), for example, must return mathematically the same value as floor(a/b). This is the case for most a and b, but fld returns NaN for a = Inf.

julia> VERSION
v"0.7.0-DEV.4465"

julia> floor(Inf/1.0)
Inf

julia> fld(Inf, 1.0)
NaN

I get similar results for other Euclidean division functions cld and div.

Is this an intended behavior?

@wsshin
Copy link
Contributor Author

wsshin commented Apr 4, 2018

Maybe related to #9283.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Apr 8, 2021

I think this boils down to rem not being computable for this example, which we use as the means to define all of the div:

julia> rem(Inf, 1.0)
NaN

julia> /(Inf, 1.0)
Inf

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

No branches or pull requests

3 participants