Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 252 for Complex128 (0.2 sec)

  1. test/fixedbugs/issue16949.go

    	sink = make([]byte, complex64(1+0i))  // ERROR "non-integer.*len|must be integer"
    	sink = make([]byte, complex128(1+0i)) // ERROR "non-integer.*len|must be integer"
    
    	sink = make([]byte, 0, 1+0i)
    	sink = make([]byte, 0, complex64(1+0i))  // ERROR "non-integer.*cap|must be integer"
    	sink = make([]byte, 0, complex128(1+0i)) // ERROR "non-integer.*cap|must be integer"
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 09 23:56:19 UTC 2020
    - 1.1K bytes
    - Viewed (0)
  2. src/strconv/ctoa.go

    // It rounds the result assuming that the original was obtained from a complex
    // value of bitSize bits, which must be 64 for complex64 and 128 for complex128.
    func FormatComplex(c complex128, fmt byte, prec, bitSize int) string {
    	if bitSize != 64 && bitSize != 128 {
    		panic("invalid bitSize")
    	}
    	bitSize >>= 1 // complex64 uses float32 internally
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:21:28 UTC 2024
    - 1K bytes
    - Viewed (0)
  3. src/go/parser/testdata/linalg.go2

    // It would likely be in a constraints package in the standard library.
    type Numeric interface {
    	~int|~int8|~int16|~int32|~int64|
    		~uint|~uint8|~uint16|~uint32|~uint64|~uintptr|
    		~float32|~float64|
    		~complex64|~complex128
    }
    
    func DotProduct[T Numeric](s1, s2 []T) T {
    	if len(s1) != len(s2) {
    		panic("DotProduct: slices of unequal length")
    	}
    	var r T
    	for i := range s1 {
    		r += s1[i] * s2[i]
    	}
    	return r
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 15:34:22 UTC 2021
    - 2K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/util/dump/dump_test.go

    		{uintptr(93), "(uintptr) 0x5d\n"},
    		{ptrint(93), "(*int)(93)\n"},
    		{float32(93.76), "(float32) 93.76\n"},
    		{float64(93.76), "(float64) 93.76\n"},
    		{complex64(93i), "(complex64) (0+93i)\n"},
    		{complex128(93i), "(complex128) (0+93i)\n"},
    		{bool(true), "(bool) true\n"},
    		{bool(false), "(bool) false\n"},
    		{string("test"), "(string) (len=4) \"test\"\n"},
    		{ptrstr("test"), "(*string)((len=4) \"test\")\n"},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 27 01:24:22 UTC 2023
    - 10.3K bytes
    - Viewed (0)
  5. test/ken/cplx4.go

    package main
    
    import "fmt"
    
    const (
    	R = 5
    	I = 6i
    
    	C1 = R + I // ADD(5,6)
    )
    
    func want(s, w string) {
    	if s != w {
    		panic(s + " != " + w)
    	}
    }
    
    func doprint(c complex128, w string) {
    	s := fmt.Sprintf("%f", c)
    	want(s, w)
    }
    
    func main() {
    
    	// constants
    	s := fmt.Sprintf("%f", -C1)
    	want(s, "(-5.000000-6.000000i)")
    	doprint(C1, "(5.000000+6.000000i)")
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 24 05:24:24 UTC 2012
    - 1K bytes
    - Viewed (0)
  6. test/typeparam/absdiffimp.dir/a.go

    package a
    
    type Numeric interface {
    	~int | ~int8 | ~int16 | ~int32 | ~int64 |
    		~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr |
    		~float32 | ~float64 |
    		~complex64 | ~complex128
    }
    
    // numericAbs matches numeric types with an Abs method.
    type numericAbs[T any] interface {
    	Numeric
    	Abs() T
    }
    
    // AbsDifference computes the absolute value of the difference of
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 00:11:24 UTC 2021
    - 2.1K bytes
    - Viewed (0)
  7. src/go/constant/example_test.go

    	}
    	C := complex(Ar, Ai)
    
    	fmt.Println("literal", 25.3+55i)
    	fmt.Println("go/constant", c)
    	fmt.Println("complex128", C)
    
    	// Output:
    	//
    	// Could not represent real part 25.3 exactly as float64
    	// literal (25.3+55i)
    	// go/constant (25.3 + 55i)
    	// complex128 (25.299999999999997+55i)
    }
    
    func ExampleBinaryOp() {
    	// 11 / 0.5
    	a := constant.MakeUint64(11)
    	b := constant.MakeFloat64(0.5)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  8. src/strconv/atoc.go

    			return nil, x
    		}
    	}
    	return err, nil
    }
    
    // ParseComplex converts the string s to a complex number
    // with the precision specified by bitSize: 64 for complex64, or 128 for complex128.
    // When bitSize=64, the result still has type complex128, but it will be
    // convertible to complex64 without changing its value.
    //
    // The number represented by s must be of the form N, Ni, or N±Ni, where N stands
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun May 05 00:24:26 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  9. test/fixedbugs/issue52862.dir/a.go

    // Copyright 2022 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package a
    
    func F() complex128 {
    	return 0+0i
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 27 16:12:51 UTC 2022
    - 208 bytes
    - Viewed (0)
  10. test/cmplxdivide.c

    	printf("\tnan     = math.NaN()\n");
    	printf("\tinf     = math.Inf(1)\n");
    	printf("\tzero    = 0.0\n");
    	printf(")\n");
    	printf("\n");
    	printf("var tests = []struct {\n");
    	printf("\tf, g complex128\n");
    	printf("\tout  complex128\n");
    	printf("}{\n");
    
    	for(i=0; i<nelem(f); i++)
    	for(j=0; j<nelem(f); j++)
    	for(k=0; k<nelem(f); k++)
    	for(l=0; l<nelem(f); l++) {
    		n = f[i] + f[j]*I;
    		d = f[k] + f[l]*I;
    		q = n/d;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 15 22:45:17 UTC 2017
    - 2.1K bytes
    - Viewed (0)
Back to top