Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 1,328 for FLOAT64 (0.16 sec)

  1. test/typeparam/sum.go

    package main
    
    import (
    	"fmt"
    )
    
    func Sum[T interface{ int | float64 }](vec []T) T {
    	var sum T
    	for _, elt := range vec {
    		sum = sum + elt
    	}
    	return sum
    }
    
    func Abs(f float64) float64 {
    	if f < 0.0 {
    		return -f
    	}
    	return f
    }
    
    func main() {
    	vec1 := []int{3, 4}
    	vec2 := []float64{5.8, 9.6}
    	got := Sum[int](vec1)
    	want := vec1[0] + vec1[1]
    	if got != want {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 923 bytes
    - Viewed (0)
  2. test/fixedbugs/bug109.go

    package bug109
    
    func f(a float64) float64 {
    	e := 1.0
    	e = e * a
    	return e
    }
    
    /*
    6g bugs/bug109.go
    bugs/bug109.go:5: illegal types for operand: MUL
    	(<float64>FLOAT64)
    	(<float32>FLOAT32)
    bugs/bug109.go:5: illegal types for operand: AS
    	(<float64>FLOAT64)
    bugs/bug109.go:6: illegal types for operand: RETURN
    	(<float32>FLOAT32)
    	(<float64>FLOAT64)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 18 21:15:42 UTC 2012
    - 523 bytes
    - Viewed (0)
  3. pkg/test/loadbalancersim/lb_test.go

    }
    
    func (tm testMetrics) sameZonePercent() float64 {
    	return (float64(tm.requestsSameZone) / float64(tm.totalRequests())) * 100
    }
    
    func (tm testMetrics) sameRegionPercent() float64 {
    	return (float64(tm.requestsSameRegion) / float64(tm.totalRequests())) * 100
    }
    
    func (tm testMetrics) otherRegionPercent() float64 {
    	return (float64(tm.requestsOtherRegion) / float64(tm.totalRequests())) * 100
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 19 23:29:30 UTC 2022
    - 11K bytes
    - Viewed (0)
  4. src/math/frexp.go

    //
    // Special cases are:
    //
    //	Frexp(±0) = ±0, 0
    //	Frexp(±Inf) = ±Inf, 0
    //	Frexp(NaN) = NaN, 0
    func Frexp(f float64) (frac float64, exp int) {
    	if haveArchFrexp {
    		return archFrexp(f)
    	}
    	return frexp(f)
    }
    
    func frexp(f float64) (frac float64, exp int) {
    	// special cases
    	switch {
    	case f == 0:
    		return f, 0 // correctly return -0
    	case IsInf(f, 0) || IsNaN(f):
    		return f, 0
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 929 bytes
    - Viewed (0)
  5. src/runtime/float.go

    //
    // Special cases are:
    //
    //	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)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 02:39:39 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  6. test/const.go

    	// Issue #34563
    	_ = string(int(123))
    	_ = string(rune(456))
    )
    
    const (
    	f0              = 0.0
    	fm1             = -1.
    	fhuge   float64 = 1 << 100
    	fhuge_1 float64 = chuge - 1
    	f1      float64 = chuge >> 100
    	f3div2          = 3. / 2.
    	f1e3    float64 = 1e3
    )
    
    func assert(t bool, s string) {
    	if !t {
    		panic(s)
    	}
    }
    
    func ints() {
    	assert(c0 == 0, "c0")
    	assert(c1 == 1, "c1")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 26 23:54:29 UTC 2019
    - 4.8K bytes
    - Viewed (0)
  7. test/typeparam/listimp.dir/main.go

    	b1 := &a.List[byte]{b2, byte(2)}
    	if got, want := b1.Largest(), byte(3); got != want {
    		panic(fmt.Sprintf("got %d, want %d", got, want))
    	}
    
    	f3 := &a.List[float64]{nil, 13.5}
    	f2 := &a.List[float64]{f3, 1.2}
    	f1 := &a.List[float64]{f2, 4.5}
    	if got, want := f1.Largest(), 13.5; got != want {
    		panic(fmt.Sprintf("got %f, want %f", got, want))
    	}
    
    	s3 := &a.List[string]{nil, "dd"}
    	s2 := &a.List[string]{s3, "aa"}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  8. src/math/sin.go

    }
    
    // Cos returns the cosine of the radian argument x.
    //
    // Special cases are:
    //
    //	Cos(±Inf) = NaN
    //	Cos(NaN) = NaN
    func Cos(x float64) float64 {
    	if haveArchCos {
    		return archCos(x)
    	}
    	return cos(x)
    }
    
    func cos(x float64) float64 {
    	const (
    		PI4A = 7.85398125648498535156e-1  // 0x3fe921fb40000000, Pi/4 split into three parts
    		PI4B = 3.77489470793079817668e-8  // 0x3e64442d00000000,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 6.4K bytes
    - Viewed (0)
  9. test/zerodivide.go

    	ErrorTest{"float64 0/0", func() { use(f / g) }, ""},
    	ErrorTest{"float32 0/0", func() { use(f32 / g32) }, ""},
    	ErrorTest{"float64 0/0", func() { use(f64 / g64) }, ""},
    
    	ErrorTest{"float64 1/0", func() { use(h / g) }, ""},
    	ErrorTest{"float32 1/0", func() { use(h32 / g32) }, ""},
    	ErrorTest{"float64 1/0", func() { use(h64 / g64) }, ""},
    	ErrorTest{"float64 inf/0", func() { use(inf / g64) }, ""},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 06 15:53:04 UTC 2021
    - 5.7K bytes
    - Viewed (0)
  10. cmd/rebalance-admin.go

    		// i.e. x = c_i*pfc -f_i
    		totalBytesToRebal := float64(ps.InitCapacity)*meta.PercentFreeGoal - float64(ps.InitFreeSpace)
    		elapsed := time.Since(ps.Info.StartTime)
    		eta := time.Duration(totalBytesToRebal * float64(elapsed) / float64(ps.Bytes))
    		if !ps.Info.EndTime.IsZero() {
    			stopTime = ps.Info.EndTime
    		}
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Dec 22 00:56:43 UTC 2023
    - 3.8K bytes
    - Viewed (0)
Back to top