On 2016-08-05 at 20:03 Kyle Milka <[email protected]> wrote: > Oh yes, if lguest does a cast we should just do that too. When I initially > looked at it I was expecting that the unsigned math would take care of the > wrap around, but for some reason or another the result wasn't in the range > of a uint16. I'll change it to use the cast and verify that it works.
Yeah, it's a bit tricky. The reason everything wasn't taken care of was due to the numbers being u16s, which get converted up to unsigned ints when we do the subtraction. It certainly seems like a mess, though I'd have to consult a language lawyer for the details. Here's a couple fun links: http://stackoverflow.com/questions/32959564/subtraction-of-two-unsigned-gives-signed https://critical.eschertech.com/2010/04/07/danger-unsigned-types-used-here/ Barret -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
