From 8a0924ab4b0a2e0ee52dc1f5ae9c12b7e6fb740d Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Wed, 18 May 2022 11:06:03 +0800 Subject: [PATCH] Update math.md --- contents/algorithms/math.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contents/algorithms/math.md b/contents/algorithms/math.md index bd17015e..780c8cef 100644 --- a/contents/algorithms/math.md +++ b/contents/algorithms/math.md @@ -47,7 +47,7 @@ When a question involves "whether a number is a multiple of X", the modulo opera ### Comparing floats -When dealing with floating point numbers, take note of rounding mistakes. Consider using epsilon comparisons instead of equality checks. E.g. `abs(x - y) <= 10e-7` instead of `x == y`. +When dealing with floating point numbers, take note of rounding mistakes. Consider using epsilon comparisons instead of equality checks. E.g. `abs(x - y) <= 1e-6` instead of `x == y`. ### Fast operators