[go-nuts] Re: overflow, underflow, carry, zero etc in integer ops

2016-07-13 Thread xiiophen
On Tuesday, 12 July 2016 17:40:17 UTC+1, Uli Kunitz wrote: > > You need compare the result with one summand to detect overflow. > > See here: https://play.golang.org/p/3Uh0eFSbQW > > Programming languages usually don't provide access to machine level flags, > because they support combining multi

[go-nuts] Re: overflow, underflow, carry, zero etc in integer ops

2016-07-12 Thread Uli Kunitz
You need compare the result with one summand to detect overflow. See here: https://play.golang.org/p/3Uh0eFSbQW Programming languages usually don't provide access to machine level flags, because they support combining multiple operations in one expression. For example what should the carry flag