Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 252 for Complex128 (0.16 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. src/math/cmplx/asin.go

    //    IEEE      -10,+10     30000      1.8e-14      2.2e-15
    
    // Acos returns the inverse cosine of x.
    func Acos(x complex128) complex128 {
    	w := Asin(x)
    	return complex(math.Pi/2-real(w), -imag(w))
    }
    
    // Acosh returns the inverse hyperbolic cosine of x.
    func Acosh(x complex128) complex128 {
    	if x == 0 {
    		return complex(0, math.Copysign(math.Pi/2, imag(x)))
    	}
    	w := Acos(x)
    	if imag(w) <= 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 5.9K bytes
    - Viewed (0)
  9. src/math/cmplx/conj.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package cmplx
    
    // Conj returns the complex conjugate of x.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 292 bytes
    - Viewed (0)
  10. test/fixedbugs/issue11590.go

    package p
    
    var _ = int8(4) * 300         // ERROR "overflows int8"
    var _ = complex64(1) * 1e200  // ERROR "complex real part overflow|overflows complex64"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 11 02:26:58 UTC 2022
    - 419 bytes
    - Viewed (0)
Back to top