Skip to content

Commit

Permalink
Fixes compile warning for matching 0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pkinney committed Aug 14, 2024
1 parent a13bf5f commit f29314e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/distance/vincenty.ex
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ defmodule Distance.Vincenty do
defp calculate_cos_squared_alpha(sin_alpha), do: 1 - :math.pow(sin_alpha, 2)

@spec calculate_cos2_sigma_m(number(), number(), number(), number()) :: number()
defp calculate_cos2_sigma_m(_, _, _, 0.0), do: 0
defp calculate_cos2_sigma_m(_, _, _, +0.0), do: 0
defp calculate_cos2_sigma_m(_, _, _, -0.0), do: 0

Check warning on line 139 in lib/distance/vincenty.ex

View workflow job for this annotation

GitHub Actions / Test (Elixir 1.13.x | Erlang/OTP 24)

this clause cannot match because a previous clause at line 138 always matches

Check warning on line 139 in lib/distance/vincenty.ex

View workflow job for this annotation

GitHub Actions / Test (Elixir 1.13.x | Erlang/OTP 24)

this clause cannot match because a previous clause at line 138 always matches

Check warning on line 139 in lib/distance/vincenty.ex

View workflow job for this annotation

GitHub Actions / Test (Elixir 1.14.x | Erlang/OTP 25)

this clause cannot match because a previous clause at line 138 always matches

Check warning on line 139 in lib/distance/vincenty.ex

View workflow job for this annotation

GitHub Actions / Test (Elixir 1.14.x | Erlang/OTP 25)

this clause cannot match because a previous clause at line 138 always matches

Check warning on line 139 in lib/distance/vincenty.ex

View workflow job for this annotation

GitHub Actions / Test (Elixir 1.14.x | Erlang/OTP 26)

this clause cannot match because a previous clause at line 138 always matches

Check warning on line 139 in lib/distance/vincenty.ex

View workflow job for this annotation

GitHub Actions / Test (Elixir 1.14.x | Erlang/OTP 26)

this clause cannot match because a previous clause at line 138 always matches

defp calculate_cos2_sigma_m(sin_u1, sin_u2, cos_sigma, cos_squared_alpha) do
cos_sigma - 2 * sin_u1 * sin_u2 / cos_squared_alpha
Expand Down

0 comments on commit f29314e

Please sign in to comment.