Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for copysignSC (0.19 sec)

  1. 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)
  2. android/guava/src/com/google/common/math/DoubleMath.java

       * @since 13.0
       */
      public static boolean fuzzyEquals(double a, double b, double tolerance) {
        MathPreconditions.checkNonNegative("tolerance", tolerance);
        return Math.copySign(a - b, 1.0) <= tolerance
            // copySign(x, 1.0) is a branch-free version of abs(x), but with different NaN semantics
            || (a == b) // needed to ensure that infinities equal themselves
            || (Double.isNaN(a) && Double.isNaN(b));
      }
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 18.9K bytes
    - Viewed (0)
  3. guava/src/com/google/common/math/DoubleMath.java

       * @since 13.0
       */
      public static boolean fuzzyEquals(double a, double b, double tolerance) {
        MathPreconditions.checkNonNegative("tolerance", tolerance);
        return Math.copySign(a - b, 1.0) <= tolerance
            // copySign(x, 1.0) is a branch-free version of abs(x), but with different NaN semantics
            || (a == b) // needed to ensure that infinities equal themselves
            || (Double.isNaN(a) && Double.isNaN(b));
      }
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 18.9K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. src/math/cmplx/cmath_test.go

    		complex(1.0, zero)},
    	{complex(1.0, inf),
    		NaN()},
    	{complex(1.0, nan),
    		NaN()},
    	{complex(inf, zero),
    		complex(inf, zero)},
    	{complex(-inf, 1.0),
    		complex(math.Copysign(0.0, math.Cos(1.0)), math.Copysign(0.0, math.Sin(1.0)))}, // +0 cis(y)
    	{complex(inf, 1.0),
    		complex(inf*math.Cos(1.0), inf*math.Sin(1.0))}, // +inf  cis(y)
    	{complex(-inf, inf),
    		complex(zero, zero)}, // real and imaginary sign unspecified
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 48.1K bytes
    - Viewed (0)
  9. src/encoding/json/encode_test.go

    					test(next(f, smaller), bits)
    					if nfail > 50 {
    						t.Fatalf("stopping test early")
    					}
    				}
    			}
    		}
    	}
    	test(0, 64)
    	test(math.Copysign(0, -1), 64)
    	test(0, 32)
    	test(math.Copysign(0, -1), 32)
    }
    
    func TestMarshalRawMessageValue(t *testing.T) {
    	type (
    		T1 struct {
    			M RawMessage `json:",omitempty"`
    		}
    		T2 struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 29.4K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/appendixa_test.go

    		},
    		{
    			example: hex("3903e7"),
    			decoded: int64(-1000),
    		},
    		{
    			example: hex("f90000"),
    			decoded: 0.0,
    		},
    		{
    			example: hex("f98000"),
    			decoded: math.Copysign(0, -1),
    		},
    		{
    			example: hex("f93c00"),
    			decoded: 1.0,
    		},
    		{
    			example: hex("fb3ff199999999999a"),
    			decoded: 1.1,
    		},
    		{
    			example: hex("f93e00"),
    			decoded: 1.5,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Feb 15 18:59:36 UTC 2024
    - 15.8K bytes
    - Viewed (0)
Back to top