Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 252 for fComplex128 (0.28 sec)

  1. test/fixedbugs/issue4264.go

    // license that can be found in the LICENSE file.
    
    // issue 4264: reject int division by const 0
    
    package main
    
    func main() {
    	var x int
    	var y float64
    	var z complex128
    
    	println(x/0) // ERROR "division by zero"
    	println(y/0)
    	println(z/0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 30 19:21:08 UTC 2013
    - 366 bytes
    - Viewed (0)
  2. src/math/cmplx/abs.go

    // Annex G IEC 60559-compatible complex arithmetic.
    package cmplx
    
    import "math"
    
    // Abs returns the absolute value (also called the modulus) of x.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 523 bytes
    - Viewed (0)
  3. test/map.go

    		m[nz] = "-0"
    		if m[pz] != "-0" {
    			panic(fmt.Sprintln("complex128 map does not treat -0 and +0 as equal for write"))
    		}
    		if _, ok := m[nana]; ok {
    			panic(fmt.Sprintln("complex128 map allows NaN lookup (a)"))
    		}
    		if _, ok := m[nanb]; ok {
    			panic(fmt.Sprintln("complex128 map allows NaN lookup (b)"))
    		}
    		if len(m) != 3 {
    			panic(fmt.Sprintln("complex128 map should have 3 entries:", m))
    		}
    		m[nana] = "NaN"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 06 21:02:55 UTC 2014
    - 14.9K bytes
    - Viewed (0)
  4. test/ken/cplx0.go

    // Test trivial, bootstrap-level complex numbers, including printing.
    
    package main
    
    const (
    	R = 5
    	I = 6i
    
    	C1 = R + I // ADD(5,6)
    )
    
    func doprint(c complex128) { println(c) }
    
    func main() {
    
    	// constants
    	println(C1)
    	doprint(C1)
    
    	// variables
    	c1 := C1
    	println(c1)
    	doprint(c1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 31 17:36:45 UTC 2018
    - 455 bytes
    - Viewed (0)
  5. src/cmd/compile/internal/syntax/testdata/linalg.go

    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: Wed Mar 30 18:02:18 UTC 2022
    - 2.1K bytes
    - Viewed (0)
  6. src/math/cmplx/exp.go

    //    DEC       -10,+10      8700       3.7e-17     1.1e-17
    //    IEEE      -10,+10     30000       3.0e-16     8.7e-17
    
    // Exp returns e**x, the base-e exponential of x.
    func Exp(x complex128) complex128 {
    	switch re, im := real(x), imag(x); {
    	case math.IsInf(re, 0):
    		switch {
    		case re > 0 && im == 0:
    			return x
    		case math.IsInf(im, 0) || math.IsNaN(im):
    			if re < 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 2.1K bytes
    - Viewed (0)
  7. test/ken/cplx2.go

    		panic("fail")
    	}
    	
    	r32 := real(complex64(ce))
    	if r32 != float32(real(Ce)) {
    		println("real(complex64(ce))", r32, real(Ce))
    		panic("fail")
    	}
    	
    	r64 := real(complex128(ce))
    	if r64 != real(Ce) {
    		println("real(complex128(ce))", r64, real(Ce))
    		panic("fail")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 24 05:24:24 UTC 2012
    - 1.9K bytes
    - Viewed (0)
  8. src/go/types/exprstring_test.go

    	dup("42"),
    	dup("3.1415"),
    	dup("2.71828i"),
    	dup(`'a'`),
    	dup(`"foo"`),
    	dup("`bar`"),
    	dup("any"),
    
    	// func and composite literals
    	{"func(){}", "(func() literal)"},
    	{"func(x int) complex128 {}", "(func(x int) complex128 literal)"},
    	{"[]int{1, 2, 3}", "[]int{…}"},
    
    	// type expressions
    	dup("[1 << 10]byte"),
    	dup("[]int"),
    	dup("*int"),
    	dup("struct{x int}"),
    	dup("func()"),
    	dup("func(int, float32) string"),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 31 17:08:18 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  9. src/internal/types/testdata/fixedbugs/issue49296.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package p
    
    func _[
            T0 any,
            T1 []int,
            T2 ~float64 | ~complex128 | chan int,
    ]() {
            _ = T0(nil /* ERROR "cannot convert nil to type T0" */ )
            _ = T1(1 /* ERRORx `cannot convert 1 .* to type T1` */ )
            _ = T2(2 /* ERRORx `cannot convert 2 .* to type T2` */ )
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 560 bytes
    - Viewed (0)
  10. test/abi/fuzz_trailing_zero_field.go

    package main
    
    var p0exp = S1{
    	F1: complex(float64(2.3640607624715027), float64(-0.2717825524109192)),
    	F2: S2{F1: 9},
    	F3: 103050709,
    }
    
    type S1 struct {
    	F1 complex128
    	F2 S2
    	F3 uint64
    }
    
    type S2 struct {
    	F1 uint64
    	F2 empty
    }
    
    type empty struct {
    }
    
    //go:noinline
    //go:registerparams
    func callee(p0 S1) {
    	if p0 != p0exp {
    		panic("bad p0")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 01 15:50:43 UTC 2021
    - 551 bytes
    - Viewed (0)
Back to top