Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 37 for IsComplex (1.84 sec)

  1. src/cmd/compile/internal/typecheck/universe.go

    		if types.IsFloat[et] {
    			okforeq[et] = true
    			types.IsOrdered[et] = true
    			okforadd[et] = true
    			okforarith[et] = true
    			ir.OKForConst[et] = true
    			types.IsSimple[et] = true
    		}
    
    		if types.IsComplex[et] {
    			okforeq[et] = true
    			okforadd[et] = true
    			okforarith[et] = true
    			ir.OKForConst[et] = true
    			types.IsSimple[et] = true
    		}
    	}
    
    	types.IsSimple[types.TBOOL] = true
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  2. src/go/types/gcsizes.go

    	}
    	a := s.Sizeof(T) // may be 0 or negative
    	// spec: "For a variable x of any type: unsafe.Alignof(x) is at least 1."
    	if a < 1 {
    		return 1
    	}
    	// complex{64,128} are aligned like [2]float{32,64}.
    	if isComplex(T) {
    		a /= 2
    	}
    	if a > s.MaxAlign {
    		return s.MaxAlign
    	}
    	return a
    }
    
    func (s *gcSizes) Offsetsof(fields []*Var) []int64 {
    	offsets := make([]int64, len(fields))
    	var offs int64
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/conversions.go

    			}
    		}
    	}
    
    	// "V and T are both integer or floating point types"
    	if isIntegerOrFloat(Vu) && isIntegerOrFloat(Tu) {
    		return true
    	}
    
    	// "V and T are both complex types"
    	if isComplex(Vu) && isComplex(Tu) {
    		return true
    	}
    
    	// "V is an integer or a slice of bytes or runes and T is a string type"
    	if (isInteger(Vu) || isBytesOrRunes(Vu)) && isString(Tu) {
    		return true
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 18:51:00 UTC 2024
    - 9K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssa/decompose.go

    				}
    				f.NamedValues[*hiName] = append(f.NamedValues[*hiName], v.Args[0])
    				f.NamedValues[*loName] = append(f.NamedValues[*loName], v.Args[1])
    				toDelete = append(toDelete, namedVal{i, j})
    			}
    		case t.IsComplex():
    			rName, iName := f.SplitComplex(name)
    			newNames = maybeAppend2(f, newNames, rName, iName)
    			for j, v := range f.NamedValues[*name] {
    				if v.Op != OpComplexMake {
    					continue
    				}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 23 21:22:15 UTC 2022
    - 13.4K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/typecheck/subr.go

    		if types.SimType[src.Kind()] == types.SimType[dst.Kind()] {
    			return ir.OCONVNOP, ""
    		}
    		return ir.OCONV, ""
    	}
    
    	// 5. src and dst are both complex types.
    	if src.IsComplex() && dst.IsComplex() {
    		if types.SimType[src.Kind()] == types.SimType[dst.Kind()] {
    			return ir.OCONVNOP, ""
    		}
    		return ir.OCONV, ""
    	}
    
    	// Special case for constant conversions: any numeric
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 19:45:58 UTC 2023
    - 20.2K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/typecheck/const.go

    	} else {
    		base.Fatalf("cannot use %L as type %v", n, t)
    	}
    
    	n.SetType(nil)
    	return n
    }
    
    func operandType(op ir.Op, t *types.Type) *types.Type {
    	switch op {
    	case ir.OCOMPLEX:
    		if t.IsComplex() {
    			return types.FloatForComplex(t)
    		}
    	case ir.OREAL, ir.OIMAG:
    		if t.IsFloat() {
    			return types.ComplexForFloat(t)
    		}
    	default:
    		if okfor[op][t.Kind()] {
    			return t
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 10.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/gcsizes.go

    	}
    	a := s.Sizeof(T) // may be 0 or negative
    	// spec: "For a variable x of any type: unsafe.Alignof(x) is at least 1."
    	if a < 1 {
    		return 1
    	}
    	// complex{64,128} are aligned like [2]float{32,64}.
    	if isComplex(T) {
    		a /= 2
    	}
    	if a > s.MaxAlign {
    		return s.MaxAlign
    	}
    	return a
    }
    
    func (s *gcSizes) Offsetsof(fields []*Var) []int64 {
    	offsets := make([]int64, len(fields))
    	var offs int64
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/const.go

    			}
    			r := roundFloat64(x)
    			if r != nil {
    				*rounded = r
    				return true
    			}
    		case UntypedFloat:
    			return true
    		default:
    			panic("unreachable")
    		}
    
    	case isComplex(typ):
    		x := constant.ToComplex(x)
    		if x.Kind() != constant.Complex {
    			return false
    		}
    		switch typ.kind {
    		case Complex64:
    			if rounded == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  9. src/text/template/parse/node.go

    			return nil, err
    		}
    		n.IsComplex = true
    		n.simplifyComplex()
    		return n, nil
    	}
    	// Imaginary constants can only be complex unless they are zero.
    	if len(text) > 0 && text[len(text)-1] == 'i' {
    		f, err := strconv.ParseFloat(text[:len(text)-1], 64)
    		if err == nil {
    			n.IsComplex = true
    			n.Complex128 = complex(0, f)
    			n.simplifyComplex()
    			return n, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:57:51 UTC 2024
    - 24.2K bytes
    - Viewed (0)
  10. src/go/types/predicates.go

    func isInteger(t Type) bool        { return isBasic(t, IsInteger) }
    func isUnsigned(t Type) bool       { return isBasic(t, IsUnsigned) }
    func isFloat(t Type) bool          { return isBasic(t, IsFloat) }
    func isComplex(t Type) bool        { return isBasic(t, IsComplex) }
    func isNumeric(t Type) bool        { return isBasic(t, IsNumeric) }
    func isString(t Type) bool         { return isBasic(t, IsString) }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 17.6K bytes
    - Viewed (0)
Back to top