Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for absDifference (0.52 sec)

  1. test/typeparam/absdiffimp.dir/a.go

    }
    
    // numericAbs matches numeric types with an Abs method.
    type numericAbs[T any] interface {
    	Numeric
    	Abs() T
    }
    
    // AbsDifference computes the absolute value of the difference of
    // a and b, where the absolute value is determined by the Abs method.
    func absDifference[T numericAbs[T]](a, b T) T {
    	d := a - b
    	return d.Abs()
    }
    
    // orderedNumeric matches numeric types that support the < operator.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 00:11:24 UTC 2021
    - 2.1K bytes
    - Viewed (0)
  2. src/internal/types/testdata/check/linalg.go

    	return r
    }
    
    // NumericAbs matches numeric types with an Abs method.
    type NumericAbs[T any] interface {
    	Numeric
    
    	Abs() T
    }
    
    // AbsDifference computes the absolute value of the difference of
    // a and b, where the absolute value is determined by the Abs method.
    func AbsDifference[T NumericAbs[T]](a, b T) T {
    	d := a - b
    	return d.Abs()
    }
    
    // OrderedNumeric is a type bound that matches numeric types that support the < operator.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 02 02:58:32 UTC 2022
    - 2.2K bytes
    - Viewed (0)
  3. test/typeparam/absdiffimp2.dir/a.go

    type numericAbs[T Numeric] interface {
    	~struct{ Value_ T }
    	Abs() T
    	Value() T
    }
    
    // absDifference computes the absolute value of the difference of
    // a and b, where the absolute value is determined by the Abs method.
    func absDifference[T Numeric, U numericAbs[T]](a, b U) T {
    	d := a.Value() - b.Value()
    	dt := U{Value_: d}
    	return dt.Abs()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 09 21:26:42 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/testdata/linalg.go

    	return r
    }
    
    // NumericAbs matches numeric types with an Abs method.
    type NumericAbs[T any] interface {
    	Numeric
    
    	Abs() T
    }
    
    // AbsDifference computes the absolute value of the difference of
    // a and b, where the absolute value is determined by the Abs method.
    func AbsDifference[T NumericAbs[T]](a, b T) T {
    	d := a - b
    	return d.Abs()
    }
    
    // OrderedNumeric is a type bound that matches numeric types that support the < operator.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 30 18:02:18 UTC 2022
    - 2.1K bytes
    - Viewed (0)
  5. test/typeparam/absdiff3.go

    package main
    
    import (
    	"fmt"
    	"math"
    )
    
    type Numeric interface {
    	OrderedNumeric | Complex
    }
    
    // absDifference computes the absolute value of the difference of
    // a and b, where the absolute value is determined by the abs function.
    func absDifference[T Numeric](a, b T, abs func(a T) T) T {
    	return abs(a - b)
    }
    
    // OrderedNumeric matches numeric types that support the < operator.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 2.6K bytes
    - Viewed (0)
  6. src/go/parser/testdata/linalg.go2

    	return r
    }
    
    // NumericAbs matches numeric types with an Abs method.
    type NumericAbs[T any] interface {
    	Numeric
    
    	Abs() T
    }
    
    // AbsDifference computes the absolute value of the difference of
    // a and b, where the absolute value is determined by the Abs method.
    func AbsDifference[T NumericAbs](a, b T) T {
    	d := a - b
    	return d.Abs()
    }
    
    // OrderedNumeric is a type bound that matches numeric types that support the < operator.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 15:34:22 UTC 2021
    - 2K bytes
    - Viewed (0)
  7. test/typeparam/absdiff2.go

    type numericAbs[T Numeric] interface {
    	~struct{ Value_ T }
    	Abs() T
    	Value() T
    }
    
    // absDifference computes the absolute value of the difference of
    // a and b, where the absolute value is determined by the Abs method.
    func absDifference[T Numeric, U numericAbs[T]](a, b U) T {
    	d := a.Value() - b.Value()
    	dt := U{Value_: d}
    	return dt.Abs()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 09 21:26:42 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  8. test/typeparam/absdiff.go

    }
    
    // numericAbs matches numeric types with an Abs method.
    type numericAbs[T any] interface {
    	Numeric
    	Abs() T
    }
    
    // AbsDifference computes the absolute value of the difference of
    // a and b, where the absolute value is determined by the Abs method.
    func absDifference[T numericAbs[T]](a, b T) T {
    	d := a - b
    	return d.Abs()
    }
    
    // orderedNumeric matches numeric types that support the < operator.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 2.9K bytes
    - Viewed (0)
  9. src/internal/types/testdata/fixedbugs/issue50782.go

    }
    
    // numericAbs matches numeric types with an Abs method.
    type numericAbs[T Numeric] interface {
    	~struct{ Value T }
    	Abs() T
    }
    
    // AbsDifference computes the absolute value of the difference of
    // a and b, where the absolute value is determined by the Abs method.
    func absDifference[T numericAbs[T /* ERROR "T does not satisfy Numeric" */]](a, b T) T {
    	// Field accesses are not permitted for now. Keep an error so
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  10. src/debug/gosym/symtab_test.go

    }
    
    func TestGenericNames(t *testing.T) {
    	s1 := Sym{Name: "main.set[int]"}
    	s2 := Sym{Name: "main.(*value[int]).get"}
    	s3 := Sym{Name: "a/b.absDifference[c/d.orderedAbs[float64]]"}
    	s4 := Sym{Name: "main.testfunction[.shape.int]"}
    	assertString(t, fmt.Sprintf("package of %q", s1.Name), s1.PackageName(), "main")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 09 11:28:56 UTC 2022
    - 4.3K bytes
    - Viewed (0)
Back to top