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

Missing methods erf(x, RoundUp) #4

Open
dpsanders opened this issue Apr 30, 2018 · 5 comments
Open

Missing methods erf(x, RoundUp) #4

dpsanders opened this issue Apr 30, 2018 · 5 comments

Comments

@dpsanders
Copy link
Member

We're missing methods like erf(x, RoundUp).

cc @SebastianM-C

@SebastianM-C
Copy link
Contributor

I am not sure I understand what this part does:

for f in (:erf, :erfc)

    @eval function($f)(x::BigFloat, r::RoundingMode)
        setrounding(BigFloat, r) do
            ($f)(x)
        end
    end

    @eval ($f)(a::Interval{Float64}) = convert(Interval{Float64}, ($f)(big53(a)))

end

Was this not supposed to define the versions of the functions for all rounding modes?

@dpsanders
Copy link
Member Author

Yes, but in line 3 you can see that it only does it for x that is a BigFloat.

@dpsanders
Copy link
Member Author

It uses metaprogramming to automate the generation instead of repeating very similar code twice.
But we can equally just repeat the code twice, which may well be clearer!

@SebastianM-C
Copy link
Contributor

The metaprogramming part was quite clear, but I am not sure about the setrounding part.

Would it be better to use a parametric type instead of BigFloat or should we define explicitly what happens?

@dpsanders
Copy link
Member Author

As far as I remember / can see, we have correctly rounded functions only for BigFloat.
So the Float64 ones will have to be defined in terms of those.

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

No branches or pull requests

2 participants