Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 252 for fComplex128 (0.35 sec)

  1. src/cmd/compile/internal/test/truncconst_test.go

    		t.Errorf("real(r52-1) = %g, want %g", got, f52want)
    	}
    	if got := real(complex128(r52) - 1); got != f52want {
    		t.Errorf("real(complex128(r52)-1) = %g, want %g", got, f52want)
    	}
    	if got := real(r53 - 1); got != f53want {
    		t.Errorf("real(r53-1) = %g, want %g", got, f53want)
    	}
    	if got := real(complex128(r53) - 1); got != 0 {
    		t.Errorf("real(complex128(r53)-1) = %g, want 0", got)
    	}
    
    	const i52 = complex(0, 1+1.0/(1<<52))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 23 06:40:04 UTC 2020
    - 1.8K bytes
    - Viewed (0)
  2. test/fixedbugs/bug401.go

    // license that can be found in the LICENSE file.
    
    // Issue 2582
    package main
    
    type T struct{}
    
    //go:noinline
    func (T) cplx() complex128 {
    	return complex(1, 0)
    }
    
    func (T) cplx2() complex128 {
    	return complex(0, 1)
    }
    
    type I interface {
    	cplx() complex128
    }
    
    func main() {
    
    	var t T
    
    	if v := real(t.cplx()); v != 1 {
    		panic("not-inlined complex call failed")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 740 bytes
    - Viewed (0)
  3. src/math/cmplx/sin.go

    //    DEC       -10,+10      8400       5.3e-17     1.3e-17
    //    IEEE      -10,+10     30000       3.8e-16     1.0e-16
    // Also tested by csin(casin(z)) = z.
    
    // Sin returns the sine of x.
    func Sin(x complex128) complex128 {
    	switch re, im := real(x), imag(x); {
    	case im == 0 && (math.IsInf(re, 0) || math.IsNaN(re)):
    		return complex(math.NaN(), im)
    	case math.IsInf(im, 0):
    		switch {
    		case re == 0:
    			return x
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 18 17:59:44 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  4. test/fixedbugs/bug329.go

    package main
    
    type Value struct {
    	X interface{}
    	Y int
    }
    
    type Struct struct {
    	X complex128
    }
    
    const magic = 1 + 2i
    
    func (Value) Complex(x complex128) {
    	if x != magic {
    		println(x)
    		panic("bad complex magic")
    	}
    }
    
    func f(x *byte, y, z int) complex128 {
    	return magic
    }
    
    func (Value) Struct(x Struct) {
    	if x.X != magic {
    		println(x.X)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 707 bytes
    - Viewed (0)
  5. test/interface/assertinline.go

    	return z, ok
    }
    
    func assertbig(x interface{}) complex128 {
    	return x.(complex128) // ERROR "type assertion inlined"
    }
    
    func assertbig2(x interface{}) (complex128, bool) {
    	z, ok := x.(complex128) // ERROR "type assertion inlined"
    	return z, ok
    }
    
    func assertbig2ok(x interface{}) (complex128, bool) {
    	_, ok := x.(complex128) // ERROR "type assertion inlined"
    	return 0, ok
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 02 21:33:03 UTC 2016
    - 1.8K bytes
    - Viewed (0)
  6. test/ken/cplx3.go

    		d = - d
    	}
    	if d > 1e-6 {
    		println(i, "!= -0.1384615")
    		panic(0)
    	}
    
    	c := *(*complex128)(unsafe.Pointer(&c0))
    	if c != c0 {
    		println(c, "!=", c)
    		panic(0)
    	}
    
    	var a interface{}
    	switch c := reflect.ValueOf(a); c.Kind() {
    	case reflect.Complex64, reflect.Complex128:
    		v := c.Complex()
    		_, _ = complex128(v), true
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 24 05:24:24 UTC 2012
    - 888 bytes
    - Viewed (0)
  7. test/typeparam/issue50193.go

    import (
    	"fmt"
    )
    
    type Complex interface {
    	~complex64 | ~complex128
    }
    
    func zero[T Complex]() T {
    	return T(0)
    }
    func pi[T Complex]() T {
    	return T(3.14)
    }
    func sqrtN1[T Complex]() T {
    	return T(-1i)
    }
    
    func main() {
    	fmt.Println(zero[complex128]())
    	fmt.Println(pi[complex128]())
    	fmt.Println(sqrtN1[complex128]())
    	fmt.Println(zero[complex64]())
    	fmt.Println(pi[complex64]())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 599 bytes
    - Viewed (0)
  8. test/fixedbugs/issue21979.go

    	_ = complex128("")   // ERROR "cannot convert .. \(.*untyped string.*\) to type complex128|invalid type conversion"
    	_ = complex128(true) // ERROR "cannot convert true \(.*untyped bool.*\) to type complex128|invalid type conversion"
    	_ = complex128(-1)
    	_ = complex128(1)
    	_ = complex128(1.0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 11 02:26:58 UTC 2022
    - 2.5K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/test/testdata/compound_test.go

    //go:noinline
    func complex64_ssa(a, b complex64, x bool) complex64 {
    	var c complex64
    	if x {
    		c = a
    	} else {
    		c = b
    	}
    	return c
    }
    
    //go:noinline
    func complex128_ssa(a, b complex128, x bool) complex128 {
    	var c complex128
    	if x {
    		c = a
    	} else {
    		c = b
    	}
    	return c
    }
    
    func testComplex64(t *testing.T) {
    	var a complex64 = 1 + 2i
    	var b complex64 = 3 + 4i
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 23 06:40:04 UTC 2020
    - 2.7K bytes
    - Viewed (0)
  10. test/fixedbugs/issue26163.go

    // Issue 26163: dead store generated in late opt messes
    // up store chain calculation.
    
    package p
    
    var i int
    var A = ([]*int{})[i]
    
    var F func(float64, complex128) int
    var C chan complex128
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 03 16:14:24 UTC 2021
    - 400 bytes
    - Viewed (0)
Back to top