nickva commented on code in PR #5181:
URL: https://github.com/apache/couchdb/pull/5181#discussion_r1720599210


##########
src/config/src/config.erl:
##########
@@ -612,7 +612,13 @@ to_float_test() ->
     ?assertEqual(1.0, to_float(<<"1.0">>)),
     ?assertEqual(1.0, to_float("1.0")),
     ?assertEqual(-1.1, to_float("-01.1")),
-    ?assertEqual(0.0, to_float("-0.0")),
+    ?assertEqual(
+        case erlang:system_info(otp_release) of
+            Ver when Ver =:= "27" -> -0.0;
+            _ -> 0.0
+        end,
+        to_float("-0.0")
+    ),

Review Comment:
   For `-0.0` and `0.0` let's have two cases and use numerical comparison == 
instead of `?assertEqual/2`, just to avoid having a special with an OTP version 
in there. We just care that it parses the float and numerically (`==` instead 
of `=:=`) they should all be `0.0`.
   
   That is `?assertEqual(0.0 == to_float("-0.0"))` and `?assertEqual(0.0 == 
to_float("0.0"))`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to