1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

doc: add go playground demo

This commit is contained in:
dudaodong
2023-08-25 10:49:16 +08:00
parent cf58542b4a
commit a69d886565
2 changed files with 2 additions and 1 deletions

View File

@@ -66,6 +66,7 @@ func GreaterOrEqual(left, right any) bool {
}
// InDelta checks if two values are equal or not within a delta.
// Play: https://go.dev/play/p/TuDdcNtMkjo
func InDelta[T constraints.Integer | constraints.Float](left, right T, delta float64) bool {
return float64(mathutil.Abs(left-right)) <= delta
}