A simple example: https://play.golang.org/p/RNgW-Ya5BS
Conversions between numeric types <https://golang.org/ref/spec#Conversions>: "For the conversion of non-constant numeric values, the following rules apply: 1. When converting between integer types, if the value is a signed integer, it is sign extended to implicit infinite precision; otherwise it is zero extended. It is then truncated to fit in the result type's size. For example, if v := uint16(0x10F0), then uint32(int8(v)) == 0xFFFFFFF0. The conversion always yields a valid value; there is no indication of overflow. 2. When converting a floating-point number to an integer, the fraction is discarded (truncation towards zero)." The float result of math.Pow is larger than the largest signed integer on your machine. Converting it to a signed integer loses precision and gets turned into the smallest signed integer on your machine. This is why using larger bases for math.Pow render the same result. On Thu, Jul 28, 2016 at 8:48 PM <belrhalmia.wa...@gmail.com> wrote: > Hello everybody, can someone explain me this weird value : > > this return me this value: -9223372036854775808 > > fmt.Println(int(math.Pow(float64(9200), float64(5)))) > > > Normally 9200^5 musnt give this value even if i put a value bigger then > 9200 i receive the same value please can someone explain me why in details > please? > > > > > > > > > > > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.