Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 68 for IsInf (0.03 sec)

  1. src/math/cmplx/isinf.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package cmplx
    
    import "math"
    
    // IsInf reports whether either real(x) or imag(x) is an infinity.
    func IsInf(x complex128) bool {
    	if math.IsInf(real(x), 0) || math.IsInf(imag(x), 0) {
    		return true
    	}
    	return false
    }
    
    // Inf returns a complex infinity, complex(+Inf, +Inf).
    func Inf() complex128 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 02 22:47:58 UTC 2018
    - 506 bytes
    - Viewed (0)
  2. src/math/cmplx/sin.go

    // Sin returns the sine of x.
    func Sin(x complex128) complex128 {
    	switch re, im := real(x), imag(x); {
    	case im == 0 && (math.IsInf(re, 0) || math.IsNaN(re)):
    		return complex(math.NaN(), im)
    	case math.IsInf(im, 0):
    		switch {
    		case re == 0:
    			return x
    		case math.IsInf(re, 0) || math.IsNaN(re):
    			return complex(math.NaN(), im)
    		}
    	case re == 0 && math.IsNaN(im):
    		return x
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 18 17:59:44 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  3. src/math/atan2.go

    		}
    		return Copysign(Pi, y)
    	case x == 0:
    		return Copysign(Pi/2, y)
    	case IsInf(x, 0):
    		if IsInf(x, 1) {
    			switch {
    			case IsInf(y, 0):
    				return Copysign(Pi/4, y)
    			default:
    				return Copysign(0, y)
    			}
    		}
    		switch {
    		case IsInf(y, 0):
    			return Copysign(3*Pi/4, y)
    		default:
    			return Copysign(Pi, y)
    		}
    	case IsInf(y, 0):
    		return Copysign(Pi/2, y)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  4. src/math/hypot_amd64.s

    	DIVSD   X0, X1
    	MULSD   X1, X1
    	ADDSD   $1.0, X1
    	SQRTSD  X1, X1
    	MULSD   X1, X0
    	MOVSD   X0, ret+16(FP)
    	RET
    isInfOrNaN:
    	CMPQ    AX, BX
    	JEQ     isInf
    	CMPQ    AX, CX
    	JEQ     isInf
    	MOVQ    $NaN, AX
    	MOVQ    AX, ret+16(FP) // return NaN
    	RET
    isInf:
    	MOVQ    AX, ret+16(FP) // return +Inf
    	RET
    isZero:
    	MOVQ    $0, AX
    	MOVQ    AX, ret+16(FP) // return 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 15 15:48:19 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  5. src/runtime/complex.go

    		switch {
    		case m == 0 && (!isNaN(a) || !isNaN(b)):
    			e = copysign(inf, c) * a
    			f = copysign(inf, c) * b
    
    		case (isInf(a) || isInf(b)) && isFinite(c) && isFinite(d):
    			a = inf2one(a)
    			b = inf2one(b)
    			e = inf * (a*c + b*d)
    			f = inf * (b*c - a*d)
    
    		case (isInf(c) || isInf(d)) && isFinite(a) && isFinite(b):
    			c = inf2one(c)
    			d = inf2one(d)
    			e = 0 * (a*c + b*d)
    			f = 0 * (b*c - a*d)
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 15 22:45:17 UTC 2017
    - 1.6K bytes
    - Viewed (0)
  6. src/math/bits.go

    	//	return uint32(x>>shift)&mask == mask && x != uvinf && x != uvneginf
    	return f != f
    }
    
    // IsInf reports whether f is an infinity, according to sign.
    // If sign > 0, IsInf reports whether f is positive infinity.
    // If sign < 0, IsInf reports whether f is negative infinity.
    // If sign == 0, IsInf reports whether f is either infinity.
    func IsInf(f float64, sign int) bool {
    	// Test for infinity by comparing against maximum float.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 05 17:52:29 UTC 2022
    - 1.9K bytes
    - Viewed (0)
  7. src/math/cmplx/asin.go

    		case re == 0:
    			return complex(re, math.NaN())
    		case math.IsInf(re, 0):
    			return complex(math.NaN(), re)
    		default:
    			return NaN()
    		}
    	case math.IsInf(im, 0):
    		switch {
    		case math.IsNaN(re):
    			return x
    		case math.IsInf(re, 0):
    			return complex(math.Copysign(math.Pi/4, re), im)
    		default:
    			return complex(math.Copysign(0, re), im)
    		}
    	case math.IsInf(re, 0):
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 5.9K bytes
    - Viewed (0)
  8. src/math/logb.go

    //
    // Special cases are:
    //
    //	Logb(±Inf) = +Inf
    //	Logb(0) = -Inf
    //	Logb(NaN) = NaN
    func Logb(x float64) float64 {
    	// special cases
    	switch {
    	case x == 0:
    		return Inf(-1)
    	case IsInf(x, 0):
    		return Inf(1)
    	case IsNaN(x):
    		return x
    	}
    	return float64(ilogb(x))
    }
    
    // Ilogb returns the binary exponent of x as an integer.
    //
    // Special cases are:
    //
    //	Ilogb(±Inf) = MaxInt32
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 07 19:46:45 UTC 2022
    - 1021 bytes
    - Viewed (0)
  9. src/math/dim.go

    // with NaN and +Inf.
    func Max(x, y float64) float64 {
    	if haveArchMax {
    		return archMax(x, y)
    	}
    	return max(x, y)
    }
    
    func max(x, y float64) float64 {
    	// special cases
    	switch {
    	case IsInf(x, 1) || IsInf(y, 1):
    		return Inf(1)
    	case IsNaN(x) || IsNaN(y):
    		return NaN()
    	case x == 0 && x == y:
    		if Signbit(x) {
    			return y
    		}
    		return x
    	}
    	if x > y {
    		return x
    	}
    	return y
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 15 19:45:12 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  10. src/math/cmplx/isnan.go

    package cmplx
    
    import "math"
    
    // IsNaN reports whether either real(x) or imag(x) is NaN
    // and neither is an infinity.
    func IsNaN(x complex128) bool {
    	switch {
    	case math.IsInf(real(x), 0) || math.IsInf(imag(x), 0):
    		return false
    	case math.IsNaN(real(x)) || math.IsNaN(imag(x)):
    		return true
    	}
    	return false
    }
    
    // NaN returns a complex “not-a-number” value.
    func NaN() complex128 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 05 17:52:29 UTC 2022
    - 598 bytes
    - Viewed (0)
Back to top