Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 53 for Float64frombits (0.48 sec)

  1. src/runtime/float.go

    //
    //	abs(±Inf) = +Inf
    //	abs(NaN) = NaN
    func abs(x float64) float64 {
    	const sign = 1 << 63
    	return float64frombits(float64bits(x) &^ sign)
    }
    
    // copysign returns a value with the magnitude
    // of x and the sign of y.
    func copysign(x, y float64) float64 {
    	const sign = 1 << 63
    	return float64frombits(float64bits(x)&^sign | float64bits(y)&sign)
    }
    
    // float64bits returns the IEEE 754 binary representation of f.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 02:39:39 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  2. src/math/unsafe.go

    // and Float64bits(Float64frombits(x)) == x.
    func Float64bits(f float64) uint64 { return *(*uint64)(unsafe.Pointer(&f)) }
    
    // Float64frombits returns the floating-point number corresponding
    // to the IEEE 754 binary representation b, with the sign bit of b
    // and the result in the same bit position.
    // Float64frombits(Float64bits(x)) == x.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  3. src/math/expm1.go

    		y := 1 - (e - x)
    		y = Float64frombits(Float64bits(y) + uint64(k)<<52) // add k to y's exponent
    		return y - 1
    	}
    	if k < 20 {
    		t := Float64frombits(0x3ff0000000000000 - (0x20000000000000 >> uint(k))) // t=1-2**-k
    		y := t - (e - x)
    		y = Float64frombits(Float64bits(y) + uint64(k)<<52) // add k to y's exponent
    		return y
    	}
    	t = Float64frombits(uint64(0x3ff-k) << 52) // 2**-k
    	y := x - (e + t)
    	y++
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  4. src/math/big/float_test.go

    		{"0x1.9p-1074", math.Float64frombits(0x00000000000000002), Above},
    
    		{"0x2.0p-1074", math.Float64frombits(0x00000000000000002), Exact},
    		{"0x2.8p-1074", math.Float64frombits(0x00000000000000002), Below}, // rounded down to even
    		{"0x2.9p-1074", math.Float64frombits(0x00000000000000003), Above},
    
    		{"0x3.0p-1074", math.Float64frombits(0x00000000000000003), Exact},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 20:22:45 UTC 2024
    - 51.9K bytes
    - Viewed (0)
  5. src/internal/fuzz/encoding_test.go

    uint8(0b0000000)
    byte(0x0)
    byte('\000')
    byte('\u0000')
    byte('\'')
    math.Float64frombits(9221120237041090562)
    math.Float32frombits(2143289345)`,
    			want: `go test fuzz v1
    int(0)
    rune('A')
    int64(68719476735)
    uint32(3405705229)
    uint64(18446744073709551615)
    byte('\x00')
    byte('\x00')
    byte('\x00')
    byte('\x00')
    byte('\'')
    math.Float64frombits(0x7ff8000000000002)
    math.Float32frombits(0x7fc00001)`,
    		},
    		{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 00:20:34 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  6. src/encoding/gob/decgen.go

    	},
    	{
    		"complex128",
    		"Complex128",
    		`real := float64FromBits(state.decodeUint())
    		imag := float64FromBits(state.decodeUint())
    		slice[i] = complex(real, imag)`,
    	},
    	{
    		"float32",
    		"Float32",
    		`slice[i] = float32(float32FromBits(state.decodeUint(), ovfl))`,
    	},
    	{
    		"float64",
    		"Float64",
    		`slice[i] = float64FromBits(state.decodeUint())`,
    	},
    	{
    		"int",
    		"Int",
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 14:15:38 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  7. src/internal/fuzz/encoding.go

    	case "float64-bits":
    		if kind != token.FLOAT && kind != token.INT {
    			return nil, fmt.Errorf("integer literal required for math.Float64frombits type")
    		}
    		bits, err := parseUint(val, "uint64")
    		if err != nil {
    			return nil, err
    		}
    		return math.Float64frombits(bits.(uint64)), nil
    	default:
    		return nil, fmt.Errorf("expected []byte or primitive type")
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 30 16:39:12 UTC 2022
    - 11K bytes
    - Viewed (0)
  8. src/math/ldexp.go

    		}
    		return Inf(1)
    	}
    	var m float64 = 1
    	if exp < -1022 { // denormal
    		exp += 53
    		m = 1.0 / (1 << 53) // 2**-53
    	}
    	x &^= mask << shift
    	x |= uint64(exp+bias) << shift
    	return m * Float64frombits(x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  9. src/expvar/expvar.go

    type Float struct {
    	f atomic.Uint64
    }
    
    func (v *Float) Value() float64 {
    	return math.Float64frombits(v.f.Load())
    }
    
    func (v *Float) String() string {
    	return string(v.appendJSON(nil))
    }
    
    func (v *Float) appendJSON(b []byte) []byte {
    	return strconv.AppendFloat(b, math.Float64frombits(v.f.Load()), 'g', -1, 64)
    }
    
    // Add adds delta to v.
    func (v *Float) Add(delta float64) {
    	for {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 21:32:11 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  10. src/math/fma.go

    		// rounded value overflows exponent range
    		return Float64frombits(uint64(ps)<<63 | uvinf)
    	}
    	if pe < 0 {
    		n := uint(-pe)
    		m = m>>n | nonzero(m&(1<<n-1))
    		pe = 0
    	}
    	m = ((m + 1<<9) >> 10) & ^zero((m&(1<<10-1))^1<<9)
    	pe &= -int32(nonzero(m))
    	return Float64frombits(uint64(ps)<<63 + uint64(pe)<<52 + m)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 05 22:05:30 UTC 2023
    - 4.6K bytes
    - Viewed (0)
Back to top