Is there an 'easy' way to get this cheap from integer ops 

eg to check for carry on addition of two uint8s I need to do something like

https://play.golang.org/p/IFuQcUgJlR

(best I can think of)

I really wanted something like

var a,b uint8 = 200,100
x,error : = a+b

gives x=44, with error.carry = true and error.overflow=true .. this 
suggestion wouldn't fit with multiple value assignments eg a,b = a+b,a-b 

my current method is very cludgy, and I doubt (?) it compiles to anything 
like the minimal assembler equivalent.  

Thinking about a builtin math error variable (different from the Error 
package) - functioning as struct{overflow,carry,negative,underflow etc bool}


This isn't going to happen or be fixed soon.. Is there an easier way, in 
terms of both efficiency (ie what it compiles to) and appearance (ie "do 
what I say" quality), ..  or any other thoughts ??

-- 
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.

Reply via email to