Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for int64Val (0.16 sec)

  1. src/go/constant/value.go

    	case unknownVal:
    		return 0, false
    	default:
    		panic(fmt.Sprintf("%v not an Int", x))
    	}
    }
    
    // Uint64Val returns the Go uint64 value of x and whether the result is exact;
    // x must be an [Int] or an [Unknown]. If the result is not exact, its value is undefined.
    // If x is [Unknown], the result is (0, false).
    func Uint64Val(x Value) (uint64, bool) {
    	switch x := x.(type) {
    	case int64Val:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 34K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/walk/expr.go

    	bits := int32(8 * n.Type().Size())
    
    	if ir.IsSmallIntConst(n) {
    		v := ir.Int64Val(n)
    		return 0 <= v && v < max
    	}
    
    	switch n.Op() {
    	case ir.OAND, ir.OANDNOT:
    		n := n.(*ir.BinaryExpr)
    		v := int64(-1)
    		switch {
    		case ir.IsSmallIntConst(n.X):
    			v = ir.Int64Val(n.X)
    		case ir.IsSmallIntConst(n.Y):
    			v = ir.Int64Val(n.Y)
    			if n.Op() == ir.OANDNOT {
    				v = ^v
    				if !sign {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 27.6K bytes
    - Viewed (0)
  3. src/fmt/scan_test.go

    	{"22\n", &int8Val, int8(22)},
    	{"23\n", &int16Val, int16(23)},
    	{"24\n", &int32Val, int32(24)},
    	{"25\n", &int64Val, int64(25)},
    	{"127\n", &int8Val, int8(127)},
    	{"-21\n", &intVal, -21},
    	{"-22\n", &int8Val, int8(-22)},
    	{"-23\n", &int16Val, int16(-23)},
    	{"-24\n", &int32Val, int32(-24)},
    	{"-25\n", &int64Val, int64(-25)},
    	{"-128\n", &int8Val, int8(-128)},
    	{"+21\n", &intVal, +21},
    	{"+22\n", &int8Val, int8(+22)},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 20:25:13 UTC 2023
    - 39.3K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/typecheck/expr.go

    	n.Cap = DefaultLit(Expr(n.Cap), types.Types[types.TINT])
    
    	if ir.IsConst(n.Len, constant.Int) && ir.Int64Val(n.Len) < 0 {
    		base.Fatalf("len for OSLICEHEADER must be non-negative")
    	}
    
    	if ir.IsConst(n.Cap, constant.Int) && ir.Int64Val(n.Cap) < 0 {
    		base.Fatalf("cap for OSLICEHEADER must be non-negative")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  5. src/go/types/index.go

    		return
    	}
    
    	if x.mode != constant_ {
    		return x.typ, -1
    	}
    
    	if x.val.Kind() == constant.Unknown {
    		return
    	}
    
    	v, ok := constant.Int64Val(x.val)
    	assert(ok)
    	if max >= 0 && v >= max {
    		check.errorf(&x, InvalidIndex, invalidArg+"index %s out of bounds [0:%d]", x.val.String(), max)
    		return
    	}
    
    	// 0 <= v [ && v < max ]
    	return x.typ, v
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:17:05 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/index.go

    		return
    	}
    
    	if x.mode != constant_ {
    		return x.typ, -1
    	}
    
    	if x.val.Kind() == constant.Unknown {
    		return
    	}
    
    	v, ok := constant.Int64Val(x.val)
    	assert(ok)
    	if max >= 0 && v >= max {
    		check.errorf(&x, InvalidIndex, invalidArg+"index %s out of bounds [0:%d]", x.val.String(), max)
    		return
    	}
    
    	// 0 <= v [ && v < max ]
    	return x.typ, v
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 15 16:16:58 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/compare.go

    	return op
    }
    
    func tracecmpArg(n ir.Node, t *types.Type, init *ir.Nodes) ir.Node {
    	// Ugly hack to avoid "constant -1 overflows uintptr" errors, etc.
    	if n.Op() == ir.OLITERAL && n.Type().IsSigned() && ir.Int64Val(n) < 0 {
    		n = copyExpr(n, n.Type(), init)
    	}
    
    	return typecheck.Conv(n, t)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 21:55:14 UTC 2023
    - 16.2K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/typexpr.go

    		}
    		return -1
    	}
    
    	if isUntyped(x.typ) || isInteger(x.typ) {
    		if val := constant.ToInt(x.val); val.Kind() == constant.Int {
    			if representableConst(val, check, Typ[Int], nil) {
    				if n, ok := constant.Int64Val(val); ok && n >= 0 {
    					return n
    				}
    			}
    		}
    	}
    
    	var msg string
    	if isInteger(x.typ) {
    		msg = "invalid array length %s"
    	} else {
    		msg = "array length %s must be integer"
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  9. src/go/types/typexpr.go

    		}
    		return -1
    	}
    
    	if isUntyped(x.typ) || isInteger(x.typ) {
    		if val := constant.ToInt(x.val); val.Kind() == constant.Int {
    			if representableConst(val, check, Typ[Int], nil) {
    				if n, ok := constant.Int64Val(val); ok && n >= 0 {
    					return n
    				}
    			}
    		}
    	}
    
    	var msg string
    	if isInteger(x.typ) {
    		msg = "invalid array length %s"
    	} else {
    		msg = "array length %s must be integer"
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  10. src/go/types/stmt.go

    	// and string values, so only create Go values for these
    	// types.
    	switch val.Kind() {
    	case constant.Int:
    		if x, ok := constant.Int64Val(val); ok {
    			return x
    		}
    		if x, ok := constant.Uint64Val(val); ok {
    			return x
    		}
    	case constant.Float:
    		if x, ok := constant.Float64Val(val); ok {
    			return x
    		}
    	case constant.String:
    		return constant.StringVal(val)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
Back to top