mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
math: add a pure V math.mathutil, with generic min, max and abs functions (#9176), and use it consistently
This commit is contained in:
@@ -133,24 +133,6 @@ pub fn (mut bmp BitMap) save_raw_data(file_name string) {
|
||||
//
|
||||
// Math functions
|
||||
//
|
||||
[inline]
|
||||
fn abs(a int) int {
|
||||
if a < 0 {
|
||||
return -a
|
||||
} else {
|
||||
return a
|
||||
}
|
||||
}
|
||||
|
||||
[inline]
|
||||
fn fabs(a f32) f32 {
|
||||
if a < 0 {
|
||||
return -a
|
||||
} else {
|
||||
return a
|
||||
}
|
||||
}
|
||||
|
||||
// integer part of x
|
||||
[inline]
|
||||
fn ipart(x f32) f32 {
|
||||
|
||||
Reference in New Issue
Block a user