Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 2,166 for constant_ (0.12 sec)

  1. src/go/types/builtins.go

    			return
    		}
    
    		// if both arguments are constants, the result is a constant
    		if x.mode == constant_ && y.mode == constant_ {
    			x.val = constant.BinaryOp(constant.ToFloat(x.val), token.ADD, constant.MakeImag(constant.ToFloat(y.val)))
    		} else {
    			x.mode = value
    		}
    
    		if check.recordTypes() && x.mode != constant_ {
    			check.recordBuiltinType(call.Fun, makeSig(resTyp, x.typ, x.typ))
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  2. src/cmd/fix/gotypes_test.go

    import "go/types"
    import "go/constant"
    
    var _ = constant_.Kind
    var constant = 23 // Use of new package name.
    
    func f() {
    	_ = constant_.MakeBool(true)
    }
    `,
    	},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 23:34:33 UTC 2016
    - 1.3K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/builtins.go

    			return
    		}
    
    		// if both arguments are constants, the result is a constant
    		if x.mode == constant_ && y.mode == constant_ {
    			x.val = constant.BinaryOp(constant.ToFloat(x.val), token.ADD, constant.MakeImag(constant.ToFloat(y.val)))
    		} else {
    			x.mode = value
    		}
    
    		if check.recordTypes() && x.mode != constant_ {
    			check.recordBuiltinType(call.Fun, makeSig(resTyp, x.typ, x.typ))
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  4. src/go/types/operand.go

    // typexpr    <expr> (               <mode>                    )
    //
    // constant   <expr> (<untyped kind> <mode>                    )
    // constant   <expr> (               <mode>       of type <typ>)
    // constant   <expr> (<untyped kind> <mode> <val>              )
    // constant   <expr> (               <mode> <val> of type <typ>)
    //
    // variable   <expr> (<untyped kind> <mode>                    )
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 21:17:10 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/operand.go

    // typexpr    <expr> (               <mode>                    )
    //
    // constant   <expr> (<untyped kind> <mode>                    )
    // constant   <expr> (               <mode>       of type <typ>)
    // constant   <expr> (<untyped kind> <mode> <val>              )
    // constant   <expr> (               <mode> <val> of type <typ>)
    //
    // variable   <expr> (<untyped kind> <mode>                    )
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 21:17:10 UTC 2024
    - 11K bytes
    - Viewed (0)
  6. src/go/types/expr.go

    	case constant.Float:
    		i := constant.ToInt(x)
    		if i.Kind() != constant.Int {
    			v, _ := constant.Float64Val(x)
    			return v
    		}
    		x = i
    		fallthrough
    	case constant.Int:
    		if v, ok := constant.Int64Val(x); ok {
    			return v
    		}
    		if v, ok := constant.Uint64Val(x); ok {
    			return v
    		}
    	case constant.String:
    		return constant.StringVal(x)
    	case constant.Bool:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  7. src/go/types/index.go

    	switch typ := under(x.typ).(type) {
    	case *Basic:
    		if isString(typ) {
    			valid = true
    			if x.mode == constant_ {
    				length = int64(len(constant.StringVal(x.val)))
    			}
    			// an indexed string always yields a byte value
    			// (not a constant) even if the string and the
    			// index are constant
    			x.mode = value
    			x.typ = universeByte // use 'byte' name
    		}
    
    	case *Array:
    		valid = true
    		length = typ.len
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:17:05 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/index.go

    	switch typ := under(x.typ).(type) {
    	case *Basic:
    		if isString(typ) {
    			valid = true
    			if x.mode == constant_ {
    				length = int64(len(constant.StringVal(x.val)))
    			}
    			// an indexed string always yields a byte value
    			// (not a constant) even if the string and the
    			// index are constant
    			x.mode = value
    			x.typ = universeByte // use 'byte' name
    		}
    
    	case *Array:
    		valid = true
    		length = typ.len
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 15 16:16:58 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/const.go

    		return constant.MakeFloat64(f)
    	}
    	return nil
    }
    
    func fitsFloat64(x constant.Value) bool {
    	f, _ := constant.Float64Val(x)
    	return !math.IsInf(f, 0)
    }
    
    func roundFloat64(x constant.Value) constant.Value {
    	f, _ := constant.Float64Val(x)
    	if !math.IsInf(f, 0) {
    		return constant.MakeFloat64(f)
    	}
    	return nil
    }
    
    // representable checks that a constant operand is representable in the given
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/expr.go

    	case constant.Float:
    		i := constant.ToInt(x)
    		if i.Kind() != constant.Int {
    			v, _ := constant.Float64Val(x)
    			return v
    		}
    		x = i
    		fallthrough
    	case constant.Int:
    		if v, ok := constant.Int64Val(x); ok {
    			return v
    		}
    		if v, ok := constant.Uint64Val(x); ok {
    			return v
    		}
    	case constant.String:
    		return constant.StringVal(x)
    	case constant.Bool:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 51.7K bytes
    - Viewed (0)
Back to top