Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 67 for IsNaN (0.04 sec)

  1. src/math/expm1.go

    		Q4 = 4.00821782732936239552e-06  // 0x3ED0CFCA86E65239
    		Q5 = -2.01099218183624371326e-07 // 0xBE8AFDB76E09C32D
    	)
    
    	// special cases
    	switch {
    	case IsInf(x, 1) || IsNaN(x):
    		return x
    	case IsInf(x, -1):
    		return -1
    	}
    
    	absx := x
    	sign := false
    	if x < 0 {
    		absx = -absx
    		sign = true
    	}
    
    	// filter out huge argument
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  2. src/syscall/js/js_test.go

    	}
    	if dummys.Get("someFloat").Equal(dummys.Get("someInt")) {
    		t.Errorf("different values are not unequal")
    	}
    }
    
    func TestNaN(t *testing.T) {
    	if !dummys.Get("NaN").IsNaN() {
    		t.Errorf("JS NaN is not NaN")
    	}
    	if !js.ValueOf(math.NaN()).IsNaN() {
    		t.Errorf("Go NaN is not NaN")
    	}
    	if dummys.Get("NaN").Equal(dummys.Get("NaN")) {
    		t.Errorf("NaN is equal to NaN")
    	}
    }
    
    func TestUndefined(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 19 14:35:26 UTC 2024
    - 17.7K bytes
    - Viewed (0)
  3. src/syscall/js/js.go

    func Null() Value {
    	return valueNull
    }
    
    // IsNull reports whether v is the JavaScript value "null".
    func (v Value) IsNull() bool {
    	return v.ref == valueNull.ref
    }
    
    // IsNaN reports whether v is the JavaScript value "NaN".
    func (v Value) IsNaN() bool {
    	return v.ref == valueNaN.ref
    }
    
    // Global returns the JavaScript global object, usually "window" or "global".
    func Global() Value {
    	return valueGlobal
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 19 14:35:26 UTC 2024
    - 19.5K bytes
    - Viewed (0)
  4. src/slices/slices_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))
    }
    
    // offByOne returns true if integers v1 and v2 differ by 1.
    func offByOne(v1, v2 int) bool {
    	return v1 == v2+1 || v1 == v2-1
    }
    
    func TestEqualFunc(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:06 UTC 2024
    - 33.2K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/telemetry/internal/upload/reports.go

    		_, err := rand.Read(b)
    		if err != nil {
    			panic(fmt.Sprintf("rand.Read failed: %v", err))
    		}
    		// and turn it into a float64
    		x := math.Float64frombits(binary.LittleEndian.Uint64(b))
    		if math.IsNaN(x) || math.IsInf(x, 0) {
    			continue
    		}
    		x = math.Abs(x)
    		if x < 0x1p-1000 { // avoid underflow patterns
    			continue
    		}
    		frac, _ := math.Frexp(x) // 52 bits of randomness
    		return frac*2 - 1
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 14:52:56 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  6. src/math/lgamma.go

    		Tf    = -1.21486290535849611461e-01 // 0xBFBF19B9BCC38A42
    		// Tt = -(tail of Tf)
    		Tt = -3.63867699703950536541e-18 // 0xBC50C7CAA48A971F
    	)
    	// special cases
    	sign = 1
    	switch {
    	case IsNaN(x):
    		lgamma = x
    		return
    	case IsInf(x, 0):
    		lgamma = x
    		return
    	case x == 0:
    		lgamma = Inf(1)
    		return
    	}
    
    	neg := false
    	if x < 0 {
    		x = -x
    		neg = true
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 11K bytes
    - Viewed (0)
  7. tensorflow/cc/framework/gradient_checker.cc

            auto cur_error = std::fabs(jac_t(r, c) - jac_n(r, c));
            // Treat any NaN as max_error and immediately return.
            // (Note that std::max may ignore NaN arguments.)
            if (std::isnan(cur_error)) {
              *max_error = cur_error;
              return absl::OkStatus();
            }
            *max_error = std::max(*max_error, cur_error);
          }
        }
      }
      return absl::OkStatus();
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Apr 13 05:57:22 UTC 2024
    - 18.2K bytes
    - Viewed (0)
  8. src/math/big/ratconv_test.go

    	"1152921504606846977",  //   1<<60 + 1
    	"-1152921504606846977", // -(1<<60 + 1)
    
    	"1/3",
    }
    
    // isFinite reports whether f represents a finite rational value.
    // It is equivalent to !math.IsNan(f) && !math.IsInf(f, 0).
    func isFinite(f float64) bool {
    	return math.Abs(f) <= math.MaxFloat64
    }
    
    func TestFloat32SpecialCases(t *testing.T) {
    	for _, input := range float64inputs {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 15 22:16:34 UTC 2023
    - 19.3K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/math/QuantilesTest.java

                8, NaN,
                9, NaN,
                10, NaN);
      }
    
      public void testScale_index_compute_doubleCollection_nan() {
        assertThat(Quantiles.scale(10).index(5).compute(ONE_TO_FIVE_AND_NAN)).isNaN();
      }
    
      // 3. Tests on a mechanically generated dataset for chains starting with percentiles():
    
      private static final int PSEUDORANDOM_DATASET_SIZE = 9951;
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 29.7K bytes
    - Viewed (0)
  10. src/cmd/vendor/github.com/google/pprof/internal/driver/html/common.js

      }
    
      function nodeId(elem) {
        const id = elem.id;
        if (!id) return -1;
        if (!id.startsWith('node')) return -1;
        const n = parseInt(id.slice(4), 10);
        if (isNaN(n)) return -1;
        if (n < 0 || n >= nodes.length) return -1;
        return n;
      }
    
      // Change highlighting of node (returns true if node was found).
      function setNodeHighlight(n, set) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 16 15:19:53 UTC 2024
    - 20K bytes
    - Viewed (0)
Back to top