- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for orderedAbsDifference (0.29 sec)
-
test/typeparam/absdiff3.go
return absDifference(a, b, ComplexAbs[T]) } func main() { if got, want := OrderedAbsDifference(1.0, -2.0), 3.0; got != want { panic(fmt.Sprintf("got = %v, want = %v", got, want)) } if got, want := OrderedAbsDifference(-1.0, 2.0), 3.0; got != want { panic(fmt.Sprintf("got = %v, want = %v", got, want)) } if got, want := OrderedAbsDifference(-20, 15), 35; got != want { panic(fmt.Sprintf("got = %v, want = %v", got, want)) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 19:45:34 UTC 2022 - 2.6K bytes - Viewed (0) -
test/typeparam/absdiffimp2.dir/main.go
package main import ( "./a" "fmt" ) func main() { if got, want := a.OrderedAbsDifference(1.0, -2.0), 3.0; got != want { panic(fmt.Sprintf("got = %v, want = %v", got, want)) } if got, want := a.OrderedAbsDifference(-1.0, 2.0), 3.0; got != want { panic(fmt.Sprintf("got = %v, want = %v", got, want)) } if got, want := a.OrderedAbsDifference(-20, 15), 35; got != want { panic(fmt.Sprintf("got = %v, want = %v", got, want)) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 24 02:14:15 UTC 2022 - 879 bytes - Viewed (0) -
test/typeparam/absdiff2.go
} func main() { if got, want := OrderedAbsDifference(1.0, -2.0), 3.0; got != want { panic(fmt.Sprintf("got = %v, want = %v", got, want)) } if got, want := OrderedAbsDifference(-1.0, 2.0), 3.0; got != want { panic(fmt.Sprintf("got = %v, want = %v", got, want)) } if got, want := OrderedAbsDifference(-20, 15), 35; got != want { panic(fmt.Sprintf("got = %v, want = %v", got, want)) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 09 21:26:42 UTC 2022 - 3.6K bytes - Viewed (0) -
test/typeparam/absdiff.go
// if got, want := orderedAbsDifference(1.0, -2.0), 3.0; got != want { // panic(fmt.Sprintf("got = %v, want = %v", got, want)) // } // if got, want := orderedAbsDifference(-1.0, 2.0), 3.0; got != want { // panic(fmt.Sprintf("got = %v, want = %v", got, want)) // } // if got, want := orderedAbsDifference(-20, 15), 35; got != want { // panic(fmt.Sprintf("got = %v, want = %v", got, want))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 19:45:34 UTC 2022 - 2.9K bytes - Viewed (0) -
test/typeparam/absdiffimp.dir/main.go
// if got, want := a.OrderedAbsDifference(1.0, -2.0), 3.0; got != want { // panic(fmt.Sprintf("got = %v, want = %v", got, want)) // } // if got, want := a.OrderedAbsDifference(-1.0, 2.0), 3.0; got != want { // panic(fmt.Sprintf("got = %v, want = %v", got, want)) // } // if got, want := a.OrderedAbsDifference(-20, 15), 35; got != want {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 28 00:11:24 UTC 2021 - 998 bytes - Viewed (0) -
test/typeparam/absdiffimp.dir/a.go
// r := float64(real(a)) // i := float64(imag(a)) // d := math.Sqrt(r*r + i*i) // return complexAbs[T](complex(d, 0)) // } // // // OrderedAbsDifference returns the absolute value of the difference // // between a and b, where a and b are of an ordered type. // func OrderedAbsDifference[T orderedNumeric](a, b T) T { // return T(absDifference(orderedAbs[T](a), orderedAbs[T](b))) // } //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 28 00:11:24 UTC 2021 - 2.1K bytes - Viewed (0) -
test/typeparam/absdiffimp2.dir/a.go
d := math.Sqrt(r*r + i*i) return T(complex(d, 0)) } func (a complexAbs[T]) Value() T { return a.Value_ } // OrderedAbsDifference returns the absolute value of the difference // between a and b, where a and b are of an ordered type. func OrderedAbsDifference[T orderedNumeric](a, b T) T { return absDifference(orderedAbs[T]{a}, orderedAbs[T]{b}) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 09 21:26:42 UTC 2022 - 2.8K bytes - Viewed (0) -
src/internal/types/testdata/check/linalg.go
// // func (a ComplexAbs[T]) Abs() ComplexAbs[T] { // r := float64(real(a)) // i := float64(imag(a)) // d := math.Sqrt(r * r + i * i) // return ComplexAbs[T](complex(d, 0)) // } // // func OrderedAbsDifference[T OrderedNumeric](a, b T) T { // return T(AbsDifference(OrderedAbs[T](a), OrderedAbs[T](b))) // } // // func ComplexAbsDifference[T Complex](a, b T) T { // return T(AbsDifference(ComplexAbs[T](a), ComplexAbs[T](b)))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 02 02:58:32 UTC 2022 - 2.2K bytes - Viewed (0) -
src/cmd/compile/internal/syntax/testdata/linalg.go
type ComplexAbs[T Complex] T func (a ComplexAbs[T]) Abs() ComplexAbs[T] { r := float64(real(a)) i := float64(imag(a)) d := math.Sqrt(r * r + i * i) return ComplexAbs[T](complex(d, 0)) } func OrderedAbsDifference[T OrderedNumeric](a, b T) T { return T(AbsDifference(OrderedAbs[T](a), OrderedAbs[T](b))) } func ComplexAbsDifference[T Complex](a, b T) T { return T(AbsDifference(ComplexAbs[T](a), ComplexAbs[T](b)))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 30 18:02:18 UTC 2022 - 2.1K bytes - Viewed (0) -
src/go/parser/testdata/linalg.go2
type ComplexAbs[T Complex] T func (a ComplexAbs[T]) Abs() ComplexAbs[T] { r := float64(real(a)) i := float64(imag(a)) d := math.Sqrt(r * r + i * i) return ComplexAbs[T](complex(d, 0)) } func OrderedAbsDifference[T OrderedNumeric](a, b T) T { return T(AbsDifference(OrderedAbs[T](a), OrderedAbs[T](b))) } func ComplexAbsDifference[T Complex](a, b T) T { return T(AbsDifference(ComplexAbs[T](a), ComplexAbs[T](b)))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 28 15:34:22 UTC 2021 - 2K bytes - Viewed (0)