mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 16:32:26 -05:00
update go-sqlite3 => v0.20.0 (#3483)
This commit is contained in:
parent
d8a83860bc
commit
51cb6cae16
41 changed files with 841 additions and 263 deletions
29
vendor/github.com/ncruces/go-sqlite3/internal/util/math.go
generated
vendored
Normal file
29
vendor/github.com/ncruces/go-sqlite3/internal/util/math.go
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package util
|
||||
|
||||
import "math"
|
||||
|
||||
func abs(n int) int {
|
||||
if n < 0 {
|
||||
return -n
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func GCD(m, n int) int {
|
||||
for n != 0 {
|
||||
m, n = n, m%n
|
||||
}
|
||||
return abs(m)
|
||||
}
|
||||
|
||||
func LCM(m, n int) int {
|
||||
if n == 0 {
|
||||
return 0
|
||||
}
|
||||
return abs(n) * (abs(m) / GCD(m, n))
|
||||
}
|
||||
|
||||
// https://developer.nvidia.com/blog/lerp-faster-cuda/
|
||||
func Lerp(v0, v1, t float64) float64 {
|
||||
return math.FMA(t, v1, math.FMA(-t, v0, v0))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue