Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 326 for ABS (0.02 sec)

  1. src/math/big/intmarsh.go

    		return fmt.Errorf("Int.GobDecode: encoding version %d not supported", b>>1)
    	}
    	z.neg = b&1 != 0
    	z.abs = z.abs.setBytes(buf[1:])
    	return nil
    }
    
    // MarshalText implements the [encoding.TextMarshaler] interface.
    func (x *Int) MarshalText() (text []byte, err error) {
    	if x == nil {
    		return []byte("<nil>"), nil
    	}
    	return x.abs.itoa(x.neg, 10), nil
    }
    
    // UnmarshalText implements the [encoding.TextUnmarshaler] interface.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  2. test/typeparam/absdiff3.go

    // Abs method to a structure containing base types.
    
    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)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 2.6K bytes
    - Viewed (0)
  3. src/runtime/float.go

    	return !isNaN(f - f)
    }
    
    // isInf reports whether f is an infinity.
    func isInf(f float64) bool {
    	return !isNaN(f) && !isFinite(f)
    }
    
    // abs returns the absolute value of x.
    //
    // Special cases are:
    //
    //	abs(±Inf) = +Inf
    //	abs(NaN) = NaN
    func abs(x float64) float64 {
    	const sign = 1 << 63
    	return float64frombits(float64bits(x) &^ sign)
    }
    
    // copysign returns a value with the magnitude
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 02:39:39 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  4. src/strings/reader.go

    	r.prevRune = -1
    	var abs int64
    	switch whence {
    	case io.SeekStart:
    		abs = offset
    	case io.SeekCurrent:
    		abs = r.i + offset
    	case io.SeekEnd:
    		abs = int64(len(r.s)) + offset
    	default:
    		return 0, errors.New("strings.Reader.Seek: invalid whence")
    	}
    	if abs < 0 {
    		return 0, errors.New("strings.Reader.Seek: negative position")
    	}
    	r.i = abs
    	return abs, nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:10:31 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  5. src/internal/types/testdata/fixedbugs/issue50782.go

    type Numeric interface {
    	~int | ~int8 | ~int16 | ~int32 | ~int64
    }
    
    // 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 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/stablehlo/tests/passes/post_quantize.mlir

      // CHECK: %[[Q1:.*]] = stablehlo.uniform_quantize %[[ARG0]]
      // CHECK: %[[Q2:.*]] = stablehlo.uniform_quantize %[[Q1]]
      // CHECK: %[[ABS:.*]] = stablehlo.abs %[[Q2]]
      // CHECK: %[[DQ:.*]] = stablehlo.uniform_dequantize %[[ABS]]
      // CHECK: %[[ADD:.*]] = stablehlo.add %[[ARG0]], %[[DQ]]
      // CHECK: return %[[ADD]]
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 18 20:32:46 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  7. src/runtime/vdso_freebsd.go

    	if timekeepSharedPage == nil || timekeepSharedPage.ver != _VDSO_TK_VER_CURR {
    		return zeroBintime
    	}
    	abs := false
    	switch clockID {
    	case _CLOCK_MONOTONIC:
    		/* ok */
    	case _CLOCK_REALTIME:
    		abs = true
    	default:
    		return zeroBintime
    	}
    	return binuptime(abs)
    }
    
    func fallback_nanotime() int64
    func fallback_walltime() (sec int64, nsec int32)
    
    //go:nosplit
    func nanotime1() int64 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  8. test/typeparam/sum.go

    	}
    	got = Sum(vec1)
    	if want != got {
    		panic(fmt.Sprintf("got %d, want %d", got, want))
    	}
    
    	fwant := vec2[0] + vec2[1]
    	fgot := Sum[float64](vec2)
    	if Abs(fgot-fwant) > 1e-10 {
    		panic(fmt.Sprintf("got %f, want %f", fgot, fwant))
    	}
    	fgot = Sum(vec2)
    	if Abs(fgot-fwant) > 1e-10 {
    		panic(fmt.Sprintf("got %f, want %f", fgot, fwant))
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 923 bytes
    - Viewed (0)
  9. test/fixedbugs/issue7740.go

    	case "gc":
    		prec = math.Inf(1) // exact precision using rational arithmetic
    	case "gccgo":
    		prec = 256
    	default:
    		// unknown compiler
    		return
    	}
    	p := 1 - math.Log(math.Abs(ulp))/math.Log(2)
    	if math.Abs(p-prec) > 1e-10 {
    		fmt.Printf("BUG: got %g; want %g\n", p, prec)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 25 18:53:24 UTC 2021
    - 736 bytes
    - Viewed (0)
  10. platforms/native/platform-native/src/test/groovy/org/gradle/nativeplatform/platform/internal/ReadelfBinaryInfoTest.groovy

        19: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS sum.cpp
        20: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS multiply.cpp
        21: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
        22: 00000000004021e0     0 OBJECT  LOCAL  DEFAULT   19 __FRAME_END__
        23: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS
        24: 0000000000402014     0 NOTYPE  LOCAL  DEFAULT   18 __GNU_EH_FRAME_HDR
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Feb 05 23:09:11 UTC 2024
    - 13.9K bytes
    - Viewed (0)
Back to top