Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for copysignSC (0.12 sec)

  1. test/codegen/math.go

    	// riscv64:"FSGNJD"
    	// arm64:"ORR", -"AND"
    	sink64[1] = math.Copysign(c, -1)
    
    	// Like math.Copysign(c, -1), but with integer operations. Useful
    	// for platforms that have a copysign opcode to see if it's detected.
    	// s390x:"LNDFR\t",-"MOVD\t"     (no integer load/store)
    	sink64[2] = math.Float64frombits(math.Float64bits(a) | 1<<63)
    
    	// amd64:"ANDQ","ORQ"
    	// s390x:"CPSDR\t",-"MOVD\t"     (no integer load/store)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 15:24:29 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  2. src/runtime/minmax_test.go

    // license that can be found in the LICENSE file.
    
    package runtime_test
    
    import (
    	"math"
    	"strings"
    	"testing"
    	"unsafe"
    )
    
    var (
    	zero    = math.Copysign(0, +1)
    	negZero = math.Copysign(0, -1)
    	inf     = math.Inf(+1)
    	negInf  = math.Inf(-1)
    	nan     = math.NaN()
    )
    
    var tests = []struct{ min, max float64 }{
    	{1, 2},
    	{-2, 1},
    	{negZero, zero},
    	{zero, inf},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 26 01:41:50 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. 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)
  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/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)
  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