Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 50 for copysignSC (0.76 sec)

  1. src/math/cmplx/exp.go

    	switch re, im := real(x), imag(x); {
    	case math.IsInf(re, 0):
    		switch {
    		case re > 0 && im == 0:
    			return x
    		case math.IsInf(im, 0) || math.IsNaN(im):
    			if re < 0 {
    				return complex(0, math.Copysign(0, im))
    			} else {
    				return complex(math.Inf(1.0), math.NaN())
    			}
    		}
    	case math.IsNaN(re):
    		if im == 0 {
    			return complex(math.NaN(), im)
    		}
    	}
    	r := math.Exp(real(x))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 2.1K bytes
    - Viewed (0)
  2. src/math/cmplx/sqrt.go

    	if imag(x) == 0 {
    		// Ensure that imag(r) has the same sign as imag(x) for imag(x) == signed zero.
    		if real(x) == 0 {
    			return complex(0, imag(x))
    		}
    		if real(x) < 0 {
    			return complex(0, math.Copysign(math.Sqrt(-real(x)), imag(x)))
    		}
    		return complex(math.Sqrt(real(x)), imag(x))
    	} else if math.IsInf(imag(x), 0) {
    		return complex(math.Inf(1.0), imag(x))
    	}
    	if real(x) == 0 {
    		if imag(x) < 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 3K bytes
    - Viewed (0)
  3. src/math/example_test.go

    	fmt.Printf("%.2f", math.Atan2(0, 0))
    	// Output: 0.00
    }
    
    func ExampleAtanh() {
    	fmt.Printf("%.2f", math.Atanh(0))
    	// Output: 0.00
    }
    
    func ExampleCopysign() {
    	fmt.Printf("%.2f", math.Copysign(3.2, -1))
    	// Output: -3.20
    }
    
    func ExampleCos() {
    	fmt.Printf("%.2f", math.Cos(math.Pi/2))
    	// Output: 0.00
    }
    
    func ExampleCosh() {
    	fmt.Printf("%.2f", math.Cosh(0))
    	// Output: 1.00
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 07 18:09:53 UTC 2021
    - 3.7K bytes
    - Viewed (0)
  4. src/cmp/cmp_test.go

    // license that can be found in the LICENSE file.
    
    package cmp_test
    
    import (
    	"cmp"
    	"fmt"
    	"math"
    	"slices"
    	"sort"
    	"strings"
    	"testing"
    	"unsafe"
    )
    
    var negzero = math.Copysign(0, -1)
    var nonnilptr uintptr = uintptr(unsafe.Pointer(&negzero))
    var nilptr uintptr = uintptr(unsafe.Pointer(nil))
    
    var tests = []struct {
    	x, y    any
    	compare int
    }{
    	{1, 2, -1},
    	{1, 1, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 23:39:07 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  5. src/math/big/floatconv_test.go

    		{4.459, 'f', 3, "4.459"},
    		{5.459, 'f', 4, "5.4590"},
    
    		{0, 'b', 0, "0"},
    		{math.Copysign(0, -1), 'b', 0, "-0"},
    		{1.0, 'b', 0, "4503599627370496p-52"},
    		{-1.0, 'b', 0, "-4503599627370496p-52"},
    		{4503599627370496, 'b', 0, "4503599627370496p+0"},
    
    		{0, 'p', 0, "0"},
    		{math.Copysign(0, -1), 'p', 0, "-0"},
    		{1024.0, 'p', 0, "0x.8p+11"},
    		{-1024.0, 'p', 0, "-0x.8p+11"},
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 24.3K bytes
    - Viewed (0)
  6. src/html/template/js_test.go

    		{float32(1.0) / float32(256), " 0.00390625 ", false},
    		{float32(0), " 0 ", false},
    		{math.Copysign(0, -1), " -0 ", false},
    		{float64(1.0), " 1 ", false},
    		{float64(-1.0), " -1 ", false},
    		{float64(0.5), " 0.5 ", false},
    		{float64(-0.5), " -0.5 ", false},
    		{float64(0), " 0 ", false},
    		{math.Copysign(0, -1), " -0 ", false},
    		{"", `""`, false},
    		{"foo", `"foo"`, false},
    		// Newlines.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 02:20:11 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  7. src/runtime/map_test.go

    	m := make(map[float64]bool, 0)
    
    	m[+0.0] = true
    	m[math.Copysign(0.0, -1.0)] = true // should overwrite +0 entry
    
    	if len(m) != 1 {
    		t.Error("length wrong")
    	}
    
    	for k := range m {
    		if math.Copysign(1.0, k) > 0 {
    			t.Error("wrong sign")
    		}
    	}
    
    	m = make(map[float64]bool, 0)
    	m[math.Copysign(0.0, -1.0)] = true
    	m[+0.0] = true // should overwrite -0.0 entry
    
    	if len(m) != 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 33.5K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/ssa/_gen/WasmOps.go

    		{name: "F32Abs", asm: "F32Abs", argLength: 1, reg: fp32_11, typ: "Float32"},           // abs(arg0)
    		{name: "F32Copysign", asm: "F32Copysign", argLength: 2, reg: fp32_21, typ: "Float32"}, // copysign(arg0, arg1)
    
    		{name: "F64Sqrt", asm: "F64Sqrt", argLength: 1, reg: fp64_11, typ: "Float64"},         // sqrt(arg0)
    		{name: "F64Trunc", asm: "F64Trunc", argLength: 1, reg: fp64_11, typ: "Float64"},       // trunc(arg0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 24 00:21:13 UTC 2023
    - 17.7K bytes
    - Viewed (0)
  9. src/internal/fuzz/encoding_test.go

    		if i2 != i1 {
    			t.Fatalf("unmarshaled %v, want %v:\n%s", i2, i1, buf)
    		}
    	}
    }
    
    func FuzzFloat64RoundTrip(f *testing.F) {
    	f.Add(math.Float64bits(0))
    	f.Add(math.Float64bits(math.Copysign(0, -1)))
    	f.Add(math.Float64bits(math.MaxFloat64))
    	f.Add(math.Float64bits(math.SmallestNonzeroFloat64))
    	f.Add(math.Float64bits(math.NaN()))
    	f.Add(uint64(0x7FF0000000000001)) // signaling NaN
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 00:20:34 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  10. src/math/atan2_s390x.s

    	MOVD	$PosInf, R3
    	CMPUBEQ	R3, R1, posInfPosInf
    
    	//special case Atan2(-Inf, +Inf) = -Pi/4
    	MOVD	$NegInf, R3
    	CMPUBEQ	R3, R1, negInfPosInf
    
    	//special case Atan2(x, +Inf) = Copysign(0, x)
    	CMPBLT	R1, $0, returnNegZero
    	BR returnPosZero
    
    Normal:
    	FMOVD	x+0(FP), F0
    	FMOVD	y+8(FP), F2
    	MOVD	$·atan2rodataL25<>+0(SB), R9
    	LGDR	F0, R2
    	LGDR	F2, R1
    	RISBGNZ	$32, $63, $32, R2, R2
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 25 04:06:34 UTC 2020
    - 6.9K bytes
    - Viewed (0)
Back to top