On Fri, Mar 16, 2018 at 12:11 PM, Alex Dvoretskiy <advoretski...@gmail.com> wrote: > Hello Golangnuts, > > I'm experiencing unexpected behavior. Trying to reverse integer. > > This code works on 64-bit machine, but working wrong on 32-bit: > > https://play.golang.org/p/p4Ptu8cx-b7
on 32-bit machine, int is 32 bits, and that number overflows. Declare your variables as int64, and it should work. > > How can I generate an error in this case? > > Thanks > > -- > 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.