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

Discrepancy between Float32 and Float64 #474

Closed
arlk opened this issue Jun 3, 2021 · 1 comment · Fixed by #567
Closed

Discrepancy between Float32 and Float64 #474

arlk opened this issue Jun 3, 2021 · 1 comment · Fixed by #567

Comments

@arlk
Copy link

arlk commented Jun 3, 2021

MWE:

julia> f(x) = sin(x)^2
f (generic function with 1 method)

julia> f(-1..1)
[0, 0.708074]

julia> f(-1f0..1f0)
[-0.708074f0, 0.708074f0]

Is this simply a duplicate of #415?

@lbenet
Copy link
Member

lbenet commented Jun 3, 2021

Thanks for reporting!! The problem, I think, is related to pow function for Interval{Float32}, which is using pow in Base.

julia> (-1 .. 1)^2
[0, 1]

julia> (-1f0 .. 1f0)^2
[-1f0, 1f0]

julia> @which (-1f0 .. 1f0)^2
^(x::Number, p::Integer) in Base at intfuncs.jl:290

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.

3 participants