- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 26 for IsNaN (0.24 sec)
-
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) -
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) -
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) -
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) -
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) -
samples/bookinfo/src/ratings/ratings.js
} } dispatcher.onPost(/^\/ratings\/[0-9]*/, function (req, res) { var productIdStr = req.url.split('/').pop() var productId = parseInt(productIdStr) var ratings = {} if (Number.isNaN(productId)) { res.writeHead(400, {'Content-type': 'application/json'}) res.end(JSON.stringify({error: 'please provide numeric product ID'})) return } try { ratings = JSON.parse(req.body)
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri Sep 02 00:29:57 UTC 2022 - 8.8K bytes - Viewed (0) -
src/math/cmplx/pow.go
// // Pow(0, ±0) returns 1+0i // Pow(0, c) for real(c)<0 returns Inf+0i if imag(c) is zero, otherwise Inf+Inf i. func Pow(x, y complex128) complex128 { if x == 0 { // Guaranteed also true for x == -0. if IsNaN(y) { return NaN() } r, i := real(y), imag(y) switch { case r == 0: return 1 case r < 0: if i == 0 { return complex(math.Inf(1), 0) } return Inf() case r > 0:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 11:59:09 UTC 2023 - 2.3K bytes - Viewed (0) -
src/math/erfinv.go
// // Special cases are: // // Erfinv(1) = +Inf // Erfinv(-1) = -Inf // Erfinv(x) = NaN if x < -1 or x > 1 // Erfinv(NaN) = NaN func Erfinv(x float64) float64 { // special cases if IsNaN(x) || x <= -1 || x >= 1 { if x == -1 || x == 1 { return Inf(int(x)) } return NaN() } sign := false if x < 0 { x = -x sign = true } var ans float64
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 11:59:09 UTC 2023 - 3.4K bytes - Viewed (0) -
src/slices/sort_test.go
for i := 0; i < len(fs); i++ { testfs := Clone(fs) testfs[i] = math.NaN() fmin := Min(testfs) if !math.IsNaN(fmin) { t.Errorf("got min %v, want NaN", fmin) } fmax := Max(testfs) if !math.IsNaN(fmax) { t.Errorf("got max %v, want NaN", fmax) } } } func TestMinMaxPanics(t *testing.T) { intCmp := func(a, b int) int { return a - b }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 09 19:20:55 UTC 2024 - 9.5K bytes - Viewed (0) -
tensorflow/c/kernels/histogram_summary_op.cc
tensorflow::histogram::Histogram histo; for (int64_t i = 0; i < TF_TensorElementCount(safe_values_ptr.get()); ++i) { const double double_val = static_cast<double>(values_array[i]); if (Eigen::numext::isnan(double_val)) { std::ostringstream err; err << "Nan in summary histogram for: " << k->op_node_name; TF_SetStatus(status.get(), TF_INVALID_ARGUMENT, err.str().c_str());
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Wed Sep 06 19:12:29 UTC 2023 - 6.5K bytes - Viewed (0)