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

tools: add cmd/tools/show_ancient_deprecations.v, to cleanup ancient functionality, deprecated over an year ago (#18946)

This commit is contained in:
Delyan Angelov
2023-07-22 19:13:58 +03:00
committed by GitHub
parent 7451178c45
commit 41f99c1abf
9 changed files with 77 additions and 159 deletions

View File

@ -1,9 +0,0 @@
module math
[deprecated: 'use math.abs() instead']
pub fn fabs(x f64) f64 {
if x > 0.0 {
return x
}
return -x
}

View File

@ -84,7 +84,7 @@ pub fn approximate_with_eps(val f64, eps f64) Fraction {
if eps < 0.0 {
panic('Epsilon value cannot be negative.')
}
if math.fabs(val) > math.max_i64 {
if math.abs(val) > math.max_i64 {
panic('Value out of range.')
}
// The integer part is separated first. Then we process the fractional
@ -110,7 +110,7 @@ pub fn approximate_with_eps(val f64, eps f64) Fraction {
// eval_cf is called often so it needs to be performant
partial = eval_cf(whole, d)
// Check if we're done
if math.fabs(val - partial.f64()) < eps {
if math.abs(val - partial.f64()) < eps {
return partial
}
frac -= f64(den)