1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

math: rename small to small_ to prevent C errors (workaround unescaped C labels) (#12796)

This commit is contained in:
Wertzui123 2021-12-11 18:35:40 +01:00 committed by GitHub
parent 24bc2ae406
commit 9e68a03f94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -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 {

View File

@ -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)
}