Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 786 for overflows (0.23 sec)

  1. src/go/types/const.go

    		if isNumeric(x.typ) && isNumeric(typ) {
    			// numeric conversion : error msg
    			//
    			// integer -> integer : overflows
    			// integer -> float   : overflows (actually not possible)
    			// float   -> integer : truncated
    			// float   -> float   : overflows
    			//
    			if !isInteger(x.typ) && isInteger(typ) {
    				return nil, TruncatedFloat
    			} else {
    				return nil, NumericOverflow
    			}
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  2. test/fixedbugs/bug016.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    func main() {
    	var i int = 100
    	i = i << -3 // ERROR "overflows|negative"
    }
    
    /*
    ixedbugs/bug016.go:7: overflow converting constant to <uint32>UINT32
    fixedbugs/bug016.go:7: illegal types for operand: AS
    	(<int32>INT32)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 04:48:57 UTC 2012
    - 410 bytes
    - Viewed (0)
  3. src/math/hypot.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package math
    
    /*
    	Hypot -- sqrt(p*p + q*q), but overflows only if the result does.
    */
    
    // Hypot returns [Sqrt](p*p + q*q), taking care to avoid
    // unnecessary overflow and underflow.
    //
    // Special cases are:
    //
    //	Hypot(±Inf, q) = +Inf
    //	Hypot(p, ±Inf) = +Inf
    //	Hypot(NaN, q) = NaN
    //	Hypot(p, NaN) = NaN
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 850 bytes
    - Viewed (0)
  4. src/internal/types/testdata/check/expr1.go

    	z = z >> y
    }
    
    type myuint uint
    
    func _(x, y uint, z myuint) {
    	x = x + 1
    	x = x + - /* ERROR "overflows uint" */ 1
    	x = x + 1.0
    	x = x + 1.1 // ERROR "truncated to uint"
    	x = x + y
    	x = x - y
    	x = x * y
    	x = x / y
    	x = x % y
    	x = x << y
    	x = x >> y
    
    	z = z + 1
    	z = x + - /* ERROR "overflows uint" */ 1
    	z = z + 1.0
    	z = z + 1.1 // ERROR "truncated to uint"
    	z = z /* ERROR "mismatched types" */ + y
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  5. test/fixedbugs/bug255.go

    // var f [e]int  // ok with Go 1.17 because an error was reported for e; leads to an error for Go 1.18
    var f [ee]int      // ERROR "undefined|undeclared"
    var g [1 << 65]int // ERROR "array bound is too large|overflows|invalid array length"
    var h [len(a)]int  // ok
    
    func ff() string
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 27 18:59:51 UTC 2023
    - 852 bytes
    - Viewed (0)
  6. test/fixedbugs/issue4085a.go

    	_ = make(T, -1)    // ERROR "negative"
    	_ = make(T, 0.5)   // ERROR "constant 0.5 truncated to integer|non-integer len argument|truncated to int"
    	_ = make(T, 1.0)   // ok
    	_ = make(T, 1<<63) // ERROR "len argument too large|overflows int"
    	_ = make(T, 0, -1) // ERROR "negative cap|must not be negative"
    	_ = make(T, 10, 0) // ERROR "len larger than cap|length and capacity swapped"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 09 23:59:57 UTC 2020
    - 604 bytes
    - Viewed (0)
  7. test/fixedbugs/bug156.go

    package main
    
    func f(a int64) int64 {
    	const b int64 = 0;
    	n := a &^ b;
    	return n;
    }
    
    func main() {
    	f(1)
    }
    
    /*
    bug156.go:7: constant 18446744073709551615 overflows int64
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 18 21:15:42 UTC 2012
    - 346 bytes
    - Viewed (0)
  8. src/math/pow.go

    		if xe < -1<<12 || 1<<12 < xe {
    			// catch xe before it overflows the left shift below
    			// Since i !=0 it has at least one bit still set, so ae will accumulate xe
    			// on at least one more iteration, ae += xe is a lower bound on ae
    			// the lower bound on ae exceeds the size of a float64 exp
    			// so the final call to Ldexp will produce under/overflow (0/Inf)
    			ae += xe
    			break
    		}
    		if i&1 == 1 {
    			a1 *= x1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 24 19:10:58 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  9. src/cmd/go/internal/modindex/write.go

    func (e *encoder) Int(n int) {
    	if n < 0 || int(int32(n)) != n {
    		base.Fatalf("go: attempting to write an int to the index that overflows int32")
    	}
    	e.Uint32(uint32(n))
    }
    
    func (e *encoder) IntAt(n int, at int) {
    	if n < 0 || int(int32(n)) != n {
    		base.Fatalf("go: attempting to write an int to the index that overflows int32")
    	}
    	binary.LittleEndian.PutUint32(e.b[at:], uint32(n))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 23 10:10:21 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  10. test/fixedbugs/issue11371.go

    // integer")
    
    package issue11371
    
    const a int = 1.1        // ERROR "constant 1.1 truncated to integer|floating-point constant truncated to integer|truncated to int|truncated"
    const b int = 1e20       // ERROR "overflows int|integer constant overflow|truncated to int|truncated"
    const c int = 1 + 1e-70  // ERROR "constant truncated to integer|truncated to int|truncated"
    const d int = 1 - 1e-70  // ERROR "constant truncated to integer|truncated to int|truncated"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 23 05:11:09 UTC 2021
    - 946 bytes
    - Viewed (0)
Back to top