Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for IsNan (0.08 sec)

  1. 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)
  2. src/math/big/float.go

    }
    
    // NewFloat allocates and returns a new [Float] set to x,
    // with precision 53 and rounding mode [ToNearestEven].
    // NewFloat panics with [ErrNaN] if x is a NaN.
    func NewFloat(x float64) *Float {
    	if math.IsNaN(x) {
    		panic(ErrNaN{"NewFloat(NaN)"})
    	}
    	return new(Float).SetFloat64(x)
    }
    
    // Exponent and precision limits.
    const (
    	MaxExp  = math.MaxInt32  // largest supported exponent
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 15:46:54 UTC 2024
    - 44.5K bytes
    - Viewed (0)
  3. src/internal/trace/gc.go

    	c.mmu(window, &acc)
    
    	// Evaluate the quantiles on the accumulated MUD.
    	out := make([]float64, len(quantiles))
    	for i := range out {
    		mu, _ := acc.mud.invCumulativeSum(float64(duration) * quantiles[i])
    		if math.IsNaN(mu) {
    			// There are a few legitimate ways this can
    			// happen:
    			//
    			// 1. If the window is the full trace
    			// duration, then the windowed MU function is
    			// only defined at a single point, so the MU
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 26K bytes
    - Viewed (0)
  4. src/encoding/json/encode.go

    	e.Write(b)
    }
    
    type floatEncoder int // number of bits
    
    func (bits floatEncoder) encode(e *encodeState, v reflect.Value, opts encOpts) {
    	f := v.Float()
    	if math.IsInf(f, 0) || math.IsNaN(f) {
    		e.error(&UnsupportedValueError{v, strconv.FormatFloat(f, 'g', -1, int(bits))})
    	}
    
    	// Convert as if by ES6 number to string conversion.
    	// This matches most other JSON generators.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 36.2K bytes
    - Viewed (0)
Back to top