Standard library / reflect
reflect.Value.OverflowInt()
Check whether the candidate int value exceeds the represented numeric type’s range; does not detect every precision loss. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func (v Value) OverflowInt(x int64) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | int64 | Candidate numeric value to check against the receiver type’s range. |
Return Value
bool
Check whether the candidate int value exceeds the represented numeric type’s range; does not detect every precision loss.
Working Example
Example Snippetgo
package main
import ( "fmt" "reflect")
func main() { fmt.Println(reflect.ValueOf(int8(0)).OverflowInt(128)) }