Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 192 for isChan (0.41 sec)

  1. src/math/cmplx/isnan.go

    // license that can be found in the LICENSE file.
    
    package cmplx
    
    import "math"
    
    // IsNaN reports whether either real(x) or imag(x) is NaN
    // and neither is an infinity.
    func IsNaN(x complex128) bool {
    	switch {
    	case math.IsInf(real(x), 0) || math.IsInf(imag(x), 0):
    		return false
    	case math.IsNaN(real(x)) || math.IsNaN(imag(x)):
    		return true
    	}
    	return false
    }
    
    // NaN returns a complex “not-a-number” value.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 05 17:52:29 UTC 2022
    - 598 bytes
    - Viewed (0)
  2. src/cmd/compile/internal/ssagen/ssa.go

    func (s *state) referenceTypeBuiltin(n *ir.UnaryExpr, x *ssa.Value) *ssa.Value {
    	if !n.X.Type().IsMap() && !n.X.Type().IsChan() {
    		s.Fatalf("node must be a map or a channel")
    	}
    	if n.X.Type().IsChan() && n.Op() == ir.OLEN {
    		s.Fatalf("cannot inline len(chan)") // must use runtime.chanlen now
    	}
    	if n.X.Type().IsChan() && n.Op() == ir.OCAP {
    		s.Fatalf("cannot inline cap(chan)") // must use runtime.chancap now
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 19:44:43 UTC 2024
    - 284.9K bytes
    - Viewed (0)
  3. test/closedchan.go

    }
    
    func (c SChan) Close() {
    	close(c)
    }
    
    func (c SChan) Impl() string {
    	return "(select)"
    }
    
    // indirect operations via larger selects
    var dummy = make(chan bool)
    
    type SSChan chan int
    
    func (c SSChan) Send(x int) {
    	select {
    	case c <- x:
    	case <-dummy:
    	}
    }
    
    func (c SSChan) Nbsend(x int) bool {
    	select {
    	default:
    		return false
    	case <-dummy:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 04:48:57 UTC 2012
    - 5.8K bytes
    - Viewed (0)
  4. pkg/volume/hostpath/host_path_test.go

    			if oftc.IsBlock() {
    				t.Errorf("[%d: %q] expected socket file, got unexpected block device: %s", i, tc.name, path)
    			}
    			if oftc.IsChar() {
    				t.Errorf("[%d: %q] expected socket file, got unexpected character device: %s", i, tc.name, path)
    			}
    		}
    
    		if tc.isChar {
    			if !oftc.IsChar() {
    				t.Errorf("[%d: %q] expected character device, got unexpected: %s", i, tc.name, path)
    			}
    			if oftc.IsDir() {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 14 00:37:30 UTC 2023
    - 20.5K bytes
    - Viewed (0)
  5. src/math/cmplx/cmath_test.go

    		}
    		if math.IsNaN(imag(v.in)) || math.IsNaN(imag(v.want)) {
    			// Negating NaN is undefined with regard to the sign bit produced.
    			continue
    		}
    		// Asin(Conj(z))  == Asin(Sinh(z))
    		if f := Asin(Conj(v.in)); !cAlike(Conj(v.want), f) && !cAlike(v.in, Conj(v.in)) {
    			t.Errorf("Asin(%g) = %g, want %g", Conj(v.in), f, Conj(v.want))
    		}
    		if math.IsNaN(real(v.in)) || math.IsNaN(real(v.want)) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 48.1K bytes
    - Viewed (0)
  6. test/cmplxdivide.go

    package main
    
    import (
    	"fmt"
    	"math"
    )
    
    func calike(a, b complex128) bool {
    	if imag(a) != imag(b) && !(math.IsNaN(imag(a)) && math.IsNaN(imag(b))) {
    		return false
    	}
    
    	if real(a) != real(b) && !(math.IsNaN(real(a)) && math.IsNaN(real(b))) {
    		return false
    	}
    
    	return true
    }
    
    func main() {
    	bad := false
    	for _, t := range tests {
    		x := t.f / t.g
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 15 22:45:17 UTC 2017
    - 868 bytes
    - Viewed (0)
  7. src/math/cmplx/sin.go

    func Sin(x complex128) complex128 {
    	switch re, im := real(x), imag(x); {
    	case im == 0 && (math.IsInf(re, 0) || math.IsNaN(re)):
    		return complex(math.NaN(), im)
    	case math.IsInf(im, 0):
    		switch {
    		case re == 0:
    			return x
    		case math.IsInf(re, 0) || math.IsNaN(re):
    			return complex(math.NaN(), im)
    		}
    	case re == 0 && math.IsNaN(im):
    		return x
    	}
    	s, c := math.Sincos(real(x))
    	sh, ch := sinhcosh(imag(x))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 18 17:59:44 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  8. src/runtime/float.go

    package runtime
    
    import "unsafe"
    
    var inf = float64frombits(0x7FF0000000000000)
    
    // isNaN reports whether f is an IEEE 754 “not-a-number” value.
    func isNaN(f float64) (is bool) {
    	// IEEE 754 says that only NaNs satisfy f != f.
    	return f != f
    }
    
    // isFinite reports whether f is neither NaN nor an infinity.
    func isFinite(f float64) bool {
    	return !isNaN(f - f)
    }
    
    // isInf reports whether f is an infinity.
    func isInf(f float64) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 02:39:39 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  9. test/typeparam/ordered.go

    type orderedSlice[Elem Ordered] []Elem
    
    func (s orderedSlice[Elem]) Len() int { return len(s) }
    func (s orderedSlice[Elem]) Less(i, j int) bool {
    	if s[i] < s[j] {
    		return true
    	}
    	isNaN := func(f Elem) bool { return f != f }
    	if isNaN(s[i]) && !isNaN(s[j]) {
    		return true
    	}
    	return false
    }
    func (s orderedSlice[Elem]) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
    
    func _OrderedSlice[Elem Ordered](s []Elem) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 2.2K bytes
    - Viewed (0)
  10. src/runtime/complex.go

    		f = (imag(n)*ratio - real(n)) / denom
    	}
    
    	if isNaN(e) && isNaN(f) {
    		// Correct final result to infinities and zeros if applicable.
    		// Matches C99: ISO/IEC 9899:1999 - G.5.1  Multiplicative operators.
    
    		a, b := real(n), imag(n)
    		c, d := real(m), imag(m)
    
    		switch {
    		case m == 0 && (!isNaN(a) || !isNaN(b)):
    			e = copysign(inf, c) * a
    			f = copysign(inf, c) * b
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 15 22:45:17 UTC 2017
    - 1.6K bytes
    - Viewed (0)
Back to top