Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 50 for copysignSC (0.16 sec)

  1. src/math/all_test.go

    	{Inf(-1), NaN()},
    	{-Pi, Inf(-1)},
    	{-Pi, 0},
    	{-Pi, Inf(1)},
    	{-Pi, NaN()},
    	{Copysign(0, -1), Inf(-1)},
    	{Copysign(0, -1), -Pi},
    	{Copysign(0, -1), Copysign(0, -1)},
    	{Copysign(0, -1), 0},
    	{Copysign(0, -1), +Pi},
    	{Copysign(0, -1), Inf(1)},
    	{Copysign(0, -1), NaN()},
    	{0, Inf(-1)},
    	{0, -Pi},
    	{0, Copysign(0, -1)},
    	{0, 0},
    	{0, +Pi},
    	{0, Inf(1)},
    	{0, NaN()},
    	{+Pi, Inf(-1)},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jul 07 17:39:26 UTC 2023
    - 86.8K bytes
    - Viewed (0)
  2. src/math/copysign.go

    // Copyright 2010 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package math
    
    // Copysign returns a value with the magnitude of f
    // and the sign of sign.
    func Copysign(f, sign float64) float64 {
    	const signBit = 1 << 63
    	return Float64frombits(Float64bits(f)&^signBit | Float64bits(sign)&signBit)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 14 17:42:53 UTC 2022
    - 396 bytes
    - Viewed (0)
  3. src/math/atan2.go

    		if x >= 0 && !Signbit(x) {
    			return Copysign(0, y)
    		}
    		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):
    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/cmd/compile/internal/test/float_test.go

    	}
    	if math.Copysign(math.NaN(), -1) < math.NaN() {
    		t.Errorf("math.Copysign(math.NaN(), -1) < math.NaN() returned true")
    	}
    	if math.Inf(1) != math.Inf(1) {
    		t.Errorf("math.Inf(1) != math.Inf(1) returned true")
    	}
    	if math.Inf(-1) != math.Inf(-1) {
    		t.Errorf("math.Inf(-1) != math.Inf(-1) returned true")
    	}
    	if math.Copysign(0, -1) != 0 {
    		t.Errorf("math.Copysign(0, -1) != 0 returned true")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 05 17:54:15 UTC 2022
    - 12.5K bytes
    - Viewed (0)
  5. test/fixedbugs/issue23522.go

    	n int32
    }
    
    func F1(f float64) *S {
    	s := f
    	pf := math.Copysign(f, 1)
    	u := math.Floor(pf)
    	return &S{
    		u: int64(math.Copysign(u, s)),
    		n: int32(math.Copysign((pf-u)*1e9, s)),
    	}
    }
    
    func F2(f float64) *S {
    	s := f
    	f = math.Copysign(f, 1)
    	u := math.Floor(f)
    	return &S{
    		u: int64(math.Copysign(u, s)),
    		n: int32(math.Copysign((f-u)*1e9, s)),
    	}
    }
    
    func main() {
    	s1 := F1(-1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 23 21:51:55 UTC 2018
    - 724 bytes
    - Viewed (0)
  6. src/math/cmplx/asin.go

    		}
    	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):
    		return complex(math.Copysign(math.Pi/2, re), math.Copysign(re, im))
    	}
    	ct := complex(-imag(x), real(x)) // i * x
    	xx := x * x
    	x1 := complex(1-real(xx), -imag(xx)) // 1 - x*x
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 5.9K bytes
    - Viewed (0)
  7. src/runtime/complex.go

    		// Matches C99: ISO/IEC 9899:1999 - G.5.1  Multiplicative operators.
    
    		a, b := real(n), imag(n)
    		c, d := real(m), imag(m)
    
    		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)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 15 22:45:17 UTC 2017
    - 1.6K bytes
    - Viewed (0)
  8. src/math/cmplx/tan.go

    	switch re, im := real(x), imag(x); {
    	case math.IsInf(im, 0):
    		switch {
    		case math.IsInf(re, 0) || math.IsNaN(re):
    			return complex(math.Copysign(0, re), math.Copysign(1, im))
    		}
    		return complex(math.Copysign(0, math.Sin(2*re)), math.Copysign(1, im))
    	case re == 0 && math.IsNaN(im):
    		return x
    	}
    	d := math.Cos(2*real(x)) + math.Cosh(2*imag(x))
    	if math.Abs(d) < 0.25 {
    		d = tanSeries(x)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 8.5K bytes
    - Viewed (0)
  9. src/math/cmplx/sin.go

    func Cos(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*math.Copysign(0, re))
    	case math.IsInf(im, 0):
    		switch {
    		case re == 0:
    			return complex(math.Inf(1), -re*math.Copysign(0, im))
    		case math.IsInf(re, 0) || math.IsNaN(re):
    			return complex(math.Inf(1), math.NaN())
    		}
    	case re == 0 && math.IsNaN(im):
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 18 17:59:44 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  10. src/math/floor.go

    //	Round(NaN) = NaN
    func Round(x float64) float64 {
    	// Round is a faster implementation of:
    	//
    	// func Round(x float64) float64 {
    	//   t := Trunc(x)
    	//   if Abs(x-t) >= 0.5 {
    	//     return t + Copysign(1, x)
    	//   }
    	//   return t
    	// }
    	bits := Float64bits(x)
    	e := uint(bits>>shift) & mask
    	if e < bias {
    		// Round abs(x) < 1 including denormals.
    		bits &= signMask // +-0
    		if e == bias-1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 3.3K bytes
    - Viewed (0)
Back to top