Steven Schveighoffer:

Actually, I'm not as smart as you think ;)

There needs to be some extra checking, possibly with the carry flag.

For example:

0x70000000 - (-0x70000000)

would be less than zero as a resulting integer.

But it would work with shorts or bytes!

I remember a page about such problem in the old D wiki. I was unable to find it inside the new D wiki.

Bye,
bearophile

Reply via email to