- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 55 for IsNaN (0.04 sec)
-
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) -
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) -
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) -
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) -
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) -
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) -
src/math/cbrt.go
G = 3.57142857142857150787e-01 // 5/14 = 0x3FD6DB6DB6DB6DB7 SmallestNormal = 2.22507385850720138309e-308 // 2**-1022 = 0x0010000000000000 ) // special cases switch { case x == 0 || IsNaN(x) || IsInf(x, 0): return x } sign := false if x < 0 { x = -x sign = true } // rough cbrt to 5 bits t := Float64frombits(Float64bits(x)/3 + B1<<32) if x < SmallestNormal {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 11 16:34:30 UTC 2022 - 2.3K bytes - Viewed (0) -
pkg/test/loadbalancersim/timeseries/data.go
} return s[0] } func (s sorted) max() float64 { if len(s) == 0 { return infinity } return s[len(s)-1] } func (s sorted) quantile(phi float64) float64 { if len(s) == 0 || math.IsNaN(phi) { return nan } if phi <= 0 { return s.min() } if phi >= 1 { return s.max() } idx := uint(phi*float64(len(s)-1) + 0.5) if idx >= uint(len(s)) { idx = uint(len(s) - 1) }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Feb 03 18:19:25 UTC 2022 - 2.1K bytes - Viewed (0) -
src/runtime/mkfastlog2table.go
L6 = 1.531383769920937332e-01 /* 3FC39A09 D078C69F */ L7 = 1.479819860511658591e-01 /* 3FC2F112 DF3E5244 */ ) // special cases switch { case math.IsNaN(x) || math.IsInf(x, 1): return x case x < 0: return math.NaN() case x == 0: return math.Inf(-1) } // reduce f1, ki := math.Frexp(x) if f1 < math.Sqrt2/2 { f1 *= 2 ki-- }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Jun 26 22:12:19 UTC 2022 - 3.1K bytes - Viewed (0) -
src/math/sin.go
PI4B = 3.77489470793079817668e-8 // 0x3e64442d00000000, PI4C = 2.69515142907905952645e-15 // 0x3ce8469898cc5170, ) // special cases switch { case IsNaN(x) || IsInf(x, 0): return NaN() } // make argument positive sign := false x = Abs(x) var j uint64 var y, z float64 if x >= reduceThreshold { j, z = trigReduce(x) } else {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 11 16:34:30 UTC 2022 - 6.4K bytes - Viewed (0)