Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ErrNaN (0.06 sec)

  1. src/math/big/sqrt.go

    // case.
    func (z *Float) Sqrt(x *Float) *Float {
    	if debugFloat {
    		x.validate()
    	}
    
    	if z.prec == 0 {
    		z.prec = x.prec
    	}
    
    	if x.Sign() == -1 {
    		// following IEEE754-2008 (section 7.2)
    		panic(ErrNaN{"square root of negative operand"})
    	}
    
    	// handle ±0 and +∞
    	if x.form != finite {
    		z.acc = Exact
    		z.form = x.form
    		z.neg = x.neg // IEEE754-2008 requires √±0 = ±0
    		return z
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 2.8K bytes
    - Viewed (0)
Back to top