Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 57 for IsNaN (0.06 sec)

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

    func SliceEqual[Elem comparable](s1, s2 []Elem) bool {
    	if len(s1) != len(s2) {
    		return false
    	}
    	for i, v1 := range s1 {
    		v2 := s2[i]
    		if v1 != v2 {
    			isNaN := func(f Elem) bool { return f != f }
    			if !isNaN(v1) || !isNaN(v2) {
    				return false
    			}
    		}
    	}
    	return true
    }
    
    // Ranger returns a Sender and a Receiver. The Receiver provides a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 28 21:40:40 UTC 2021
    - 5.5K bytes
    - Viewed (0)
  2. src/slices/sort.go

    		} else {
    			j = h // preserves x[j] >= target
    		}
    	}
    	// i == j, x[i-1] < target, and x[j] (= x[i]) >= target  =>  answer is i.
    	return i, i < n && (x[i] == target || (isNaN(x[i]) && isNaN(target)))
    }
    
    // BinarySearchFunc works like [BinarySearch], but uses a custom comparison
    // function. The slice must be sorted in increasing order, where "increasing"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 07 23:54:41 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  3. test/typeparam/chansimp.dir/a.go

    func SliceEqual[Elem comparable](s1, s2 []Elem) bool {
    	if len(s1) != len(s2) {
    		return false
    	}
    	for i, v1 := range s1 {
    		v2 := s2[i]
    		if v1 != v2 {
    			isNaN := func(f Elem) bool { return f != f }
    			if !isNaN(v1) || !isNaN(v2) {
    				return false
    			}
    		}
    	}
    	return true
    }
    
    // ReadAll reads from c until the channel is closed or the context is
    // canceled, returning all the values read.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 28 21:40:40 UTC 2021
    - 5.5K bytes
    - Viewed (0)
  4. src/math/frexp.go

    		return archFrexp(f)
    	}
    	return frexp(f)
    }
    
    func frexp(f float64) (frac float64, exp int) {
    	// special cases
    	switch {
    	case f == 0:
    		return f, 0 // correctly return -0
    	case IsInf(f, 0) || IsNaN(f):
    		return f, 0
    	}
    	f, exp = normalize(f)
    	x := Float64bits(f)
    	exp += int((x>>shift)&mask) - bias + 1
    	x &^= mask << shift
    	x |= (-1 + bias) << shift
    	frac = Float64frombits(x)
    	return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 929 bytes
    - Viewed (0)
  5. test/typeparam/orderedmap.go

    func _SliceEqual[Elem comparable](s1, s2 []Elem) bool {
    	if len(s1) != len(s2) {
    		return false
    	}
    	for i, v1 := range s1 {
    		v2 := s2[i]
    		if v1 != v2 {
    			isNaN := func(f Elem) bool { return f != f }
    			if !isNaN(v1) || !isNaN(v2) {
    				return false
    			}
    		}
    	}
    	return true
    }
    
    // Ranger returns a Sender and a Receiver. The Receiver provides a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 7.1K bytes
    - Viewed (0)
  6. src/math/ldexp.go

    	}
    	return ldexp(frac, exp)
    }
    
    func ldexp(frac float64, exp int) float64 {
    	// special cases
    	switch {
    	case frac == 0:
    		return frac // correctly return -0
    	case IsInf(frac, 0) || IsNaN(frac):
    		return frac
    	}
    	frac, e := normalize(frac)
    	exp += e
    	x := Float64bits(frac)
    	exp += int(x>>shift)&mask - bias
    	if exp < -1075 {
    		return Copysign(0, frac) // underflow
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  7. src/maps/maps_test.go

    func equal[T comparable](v1, v2 T) bool {
    	return v1 == v2
    }
    
    // equalNaN is like == except that all NaNs are equal.
    func equalNaN[T comparable](v1, v2 T) bool {
    	isNaN := func(f T) bool { return f != f }
    	return v1 == v2 || (isNaN(v1) && isNaN(v2))
    }
    
    // equalStr compares ints and strings.
    func equalIntStr(v1 int, v2 string) bool {
    	return strconv.Itoa(v1) == v2
    }
    
    func TestEqualFunc(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 17:05:56 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  8. src/math/pow.go

    	if haveArchPow {
    		return archPow(x, y)
    	}
    	return pow(x, y)
    }
    
    func pow(x, y float64) float64 {
    	switch {
    	case y == 0 || x == 1:
    		return 1
    	case y == 1:
    		return x
    	case IsNaN(x) || IsNaN(y):
    		return NaN()
    	case x == 0:
    		switch {
    		case y < 0:
    			if Signbit(x) && isOddInt(y) {
    				return Inf(-1)
    			}
    			return Inf(1)
    		case y > 0:
    			if Signbit(x) && isOddInt(y) {
    				return x
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 24 19:10:58 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  9. src/math/exp.go

    		Log2e = 1.44269504088896338700e+00
    
    		Overflow  = 7.09782712893383973096e+02
    		Underflow = -7.45133219101941108420e+02
    		NearZero  = 1.0 / (1 << 28) // 2**-28
    	)
    
    	// special cases
    	switch {
    	case IsNaN(x) || IsInf(x, 1):
    		return x
    	case IsInf(x, -1):
    		return 0
    	case x > Overflow:
    		return Inf(1)
    	case x < Underflow:
    		return 0
    	case -NearZero < x && x < NearZero:
    		return 1 + x
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 5.4K bytes
    - Viewed (0)
  10. test/typeparam/maps.go

    func _SliceEqual[Elem comparable](s1, s2 []Elem) bool {
    	if len(s1) != len(s2) {
    		return false
    	}
    	for i, v1 := range s1 {
    		v2 := s2[i]
    		if v1 != v2 {
    			isNaN := func(f Elem) bool { return f != f }
    			if !isNaN(v1) || !isNaN(v2) {
    				return false
    			}
    		}
    	}
    	return true
    }
    
    // _Keys returns the keys of the map m.
    // The keys will be an indeterminate order.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 5.9K bytes
    - Viewed (0)
Back to top