Skip to content

Commit d528e90

Browse files
authored
Issue 421 (#422)
* fix undesired type promotion to Float64 * version bump * typo
1 parent 0ca2344 commit d528e90

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Roots"
22
uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
3-
version = "2.1.2"
3+
version = "2.1.3"
44

55
[deps]
66
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/hybrid.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function solve!(
8080
r, a, b = state0.xn1, state.xn0, state.xn1
8181
Δr = abs(r - b)
8282
Δx = abs(b - a)
83-
ts, TB = 1e-3, 1e2 # too small, too big
83+
ts, TB = one(r)/1000, 100*one(r) # too small, too big
8484
if Δr >= TB * Δx
8585
adj = true
8686
r = b + sign(r - b) * TB * Δx ## too big

test/test_find_zero.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ struct Order3_Test <: Roots.AbstractSecantMethod end
3636
@test find_zero(sin, 3.0, m) pi
3737
@test find_zero(sin, big(3), m) pi
3838
@test find_zero(sin, big(3.0), m) pi
39+
@test find_zero(x -> x^2 - 2.0f0, 2.0f0, m) sqrt(2) # issue 421
3940
end
4041

4142
## defaults for method argument

0 commit comments

Comments
 (0)