From f29314e379beb8841057d8691223a849b08ecdf1 Mon Sep 17 00:00:00 2001 From: Powell Kinney <628952+pkinney@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:21:13 -0500 Subject: [PATCH] Fixes compile warning for matching 0.0 --- lib/distance/vincenty.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/distance/vincenty.ex b/lib/distance/vincenty.ex index 048eaab..554ce0d 100644 --- a/lib/distance/vincenty.ex +++ b/lib/distance/vincenty.ex @@ -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 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