Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw OverflowError on
copysign(typemin(Int)//1, 1)
(JuliaLang#53395)
The default `copysign(x::Real, y::Real)` in `number.jl` works, so the incorrect method in `rational.jl` isn't needed. Here is a benchmark of the new version. ```julia using BenchmarkTools function foo!(c,a,b) c .= copysign.(a, b) nothing end N = 1000 @Btime foo!(c,a,b) setup=(c=zeros(Rational{Int},N); a=rand(Int,N).//rand(Int,N); b=fill(-1,N)) ``` On master: 406.215 ns (0 allocations: 0 bytes) On this PR: 869.327 ns (0 allocations: 0 bytes)
- Loading branch information