Removed unnecessary generic from MapFloatBetween
This commit is contained in:
parent
b0b1dd1470
commit
99a3ab4ff0
@ -2,7 +2,7 @@ package gomus
|
||||
|
||||
import "log"
|
||||
|
||||
func mapList[T any, R any](l []T, f func(T) R) []R {
|
||||
func MapList[T any, R any](l []T, f func(T) R) []R {
|
||||
var c []R = []R{}
|
||||
for _, item := range l {
|
||||
c = append(c, f(item))
|
||||
@ -16,10 +16,6 @@ func check(err error) {
|
||||
}
|
||||
}
|
||||
|
||||
type Numeric interface {
|
||||
float64
|
||||
}
|
||||
|
||||
func MapFloatBetween[T Numeric](value, start1, stop1, start2, stop2 T) T {
|
||||
func MapFloatBetween(value, start1, stop1, start2, stop2 float64) float64 {
|
||||
return start2 + (value-start1)*(stop2-start2)/(stop1-start1)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user