From 9e68a03f943731320482a220628ad14012d7bfdb Mon Sep 17 00:00:00 2001 From: Wertzui123 <46199283+Wertzui123@users.noreply.github.com> Date: Sat, 11 Dec 2021 18:35:40 +0100 Subject: [PATCH] math: rename small to small_ to prevent C errors (workaround unescaped C labels) (#12796) --- vlib/math/erf.v | 4 ++-- vlib/math/gamma.v | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vlib/math/erf.v b/vlib/math/erf.v index 23757891b..546219c14 100644 --- a/vlib/math/erf.v +++ b/vlib/math/erf.v @@ -164,7 +164,7 @@ const ( pub fn erf(a f64) f64 { mut x := a very_tiny := 2.848094538889218e-306 // 0x0080000000000000 - small := 1.0 / f64(u64(1) << 28) // 2**-28 + small_ := 1.0 / f64(u64(1) << 28) // 2**-28 if is_nan(x) { return nan() } @@ -181,7 +181,7 @@ pub fn erf(a f64) f64 { } if x < 0.84375 { // |x| < 0.84375 mut temp := 0.0 - if x < small { // |x| < 2**-28 + if x < small_ { // |x| < 2**-28 if x < very_tiny { temp = 0.125 * (8.0 * x + math.efx8 * x) // avoid underflow } else { diff --git a/vlib/math/gamma.v b/vlib/math/gamma.v index e0061db39..f8b1603ad 100644 --- a/vlib/math/gamma.v +++ b/vlib/math/gamma.v @@ -93,7 +93,7 @@ pub fn gamma(a f64) f64 { for x < 0 { if x > -1e-09 { unsafe { - goto small + goto small_ } } z = z / x @@ -102,7 +102,7 @@ pub fn gamma(a f64) f64 { for x < 2 { if x < 1e-09 { unsafe { - goto small + goto small_ } } z = z / x @@ -119,7 +119,7 @@ pub fn gamma(a f64) f64 { if true { return z * p / q } - small: + small_: if x == 0 { return inf(1) } -- 2.30.2