Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 72 for IsNan (0.03 sec)

  1. test/typeparam/sets.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
    }
    
    // A _Set is a set of elements of some type.
    type _Set[Elem comparable] struct {
    	m map[Elem]struct{}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 5.7K bytes
    - Viewed (0)
  2. guava/src/com/google/common/math/DoubleUtils.java

    import static java.lang.Double.MAX_EXPONENT;
    import static java.lang.Double.MIN_EXPONENT;
    import static java.lang.Double.POSITIVE_INFINITY;
    import static java.lang.Double.doubleToRawLongBits;
    import static java.lang.Double.isNaN;
    import static java.lang.Double.longBitsToDouble;
    import static java.lang.Math.getExponent;
    
    import com.google.common.annotations.GwtIncompatible;
    import com.google.common.annotations.VisibleForTesting;
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Apr 28 15:37:52 UTC 2021
    - 5.1K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/test/testdata/sqrtConst_test.go

    	for _, test := range tests {
    		if test.got != test.want {
    			t.Errorf("%s: math.Sqrt(%f): got %f, want %f\n", test.name, test.in, test.got, test.want)
    		}
    	}
    	for _, test := range nanTests {
    		if math.IsNaN(test.got) != true {
    			t.Errorf("%s: math.Sqrt(%f): got %f, want NaN\n", test.name, test.in, test.got)
    		}
    	}
    	if got := math.Sqrt(math.Inf(1)); !math.IsInf(got, 1) {
    		t.Errorf("math.Sqrt(+Inf), got %f, want +Inf\n", got)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 23 06:40:04 UTC 2020
    - 1.3K bytes
    - Viewed (0)
  4. test/typeparam/slices.go

    func _Equal[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
    }
    
    // _EqualFn reports whether two slices are equal using a comparison
    // function on each element.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 7.8K bytes
    - Viewed (0)
  5. src/math/asinh.go

    	const (
    		Ln2      = 6.93147180559945286227e-01 // 0x3FE62E42FEFA39EF
    		NearZero = 1.0 / (1 << 28)            // 2**-28
    		Large    = 1 << 28                    // 2**28
    	)
    	// special cases
    	if IsNaN(x) || IsInf(x, 0) {
    		return x
    	}
    	sign := false
    	if x < 0 {
    		x = -x
    		sign = true
    	}
    	var temp float64
    	switch {
    	case x > Large:
    		temp = Log(x) + Ln2 // |x| > 2**28
    	case x > 2:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 13 20:02:49 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  6. test/typeparam/chans.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: Tue Mar 01 19:45:34 UTC 2022
    - 8.4K bytes
    - Viewed (0)
  7. test/zerodivide.go

    var float64Tests = []FloatTest{
    	FloatTest{0, 0, nan},
    	FloatTest{nan, 0, nan},
    	FloatTest{inf, 0, inf},
    	FloatTest{negInf, 0, negInf},
    }
    
    func alike(a, b float64) bool {
    	switch {
    	case math.IsNaN(a) && math.IsNaN(b):
    		return true
    	case a == b:
    		return math.Signbit(a) == math.Signbit(b)
    	}
    	return false
    }
    
    func main() {
    	bad := false
    	for _, t := range errorTests {
    		err := error_(t.fn)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 06 15:53:04 UTC 2021
    - 5.7K bytes
    - Viewed (0)
  8. src/math/acosh.go

    	if haveArchAcosh {
    		return archAcosh(x)
    	}
    	return acosh(x)
    }
    
    func acosh(x float64) float64 {
    	const Large = 1 << 28 // 2**28
    	// first case is special case
    	switch {
    	case x < 1 || IsNaN(x):
    		return NaN()
    	case x == 1:
    		return 0
    	case x >= Large:
    		return Log(x) + Ln2 // x > 2**28
    	case x > 2:
    		return Log(2*x - 1/(x+Sqrt(x*x-1))) // 2**28 > x > 2
    	}
    	t := x - 1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  9. src/math/sincos.go

    		PI4B = 3.77489470793079817668e-8  // 0x3e64442d00000000,
    		PI4C = 2.69515142907905952645e-15 // 0x3ce8469898cc5170,
    	)
    	// special cases
    	switch {
    	case x == 0:
    		return x, 1 // return ±0.0, 1.0
    	case IsNaN(x) || IsInf(x, 0):
    		return NaN(), NaN()
    	}
    
    	// make argument positive
    	sinSign, cosSign := false, false
    	if x < 0 {
    		x = -x
    		sinSign = true
    	}
    
    	var j uint64
    	var y, z float64
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 1.8K bytes
    - Viewed (0)
  10. src/math/atanh.go

    	if haveArchAtanh {
    		return archAtanh(x)
    	}
    	return atanh(x)
    }
    
    func atanh(x float64) float64 {
    	const NearZero = 1.0 / (1 << 28) // 2**-28
    	// special cases
    	switch {
    	case x < -1 || x > 1 || IsNaN(x):
    		return NaN()
    	case x == 1:
    		return Inf(1)
    	case x == -1:
    		return Inf(-1)
    	}
    	sign := false
    	if x < 0 {
    		x = -x
    		sign = true
    	}
    	var temp float64
    	switch {
    	case x < NearZero:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 2K bytes
    - Viewed (0)
Back to top