Oh Dear

Daniel Keep daniel.keep.lists at gmail.com
Sun Jul 12 22:34:49 PDT 2009


bearophile wrote:
> Daniel Keep:
>> My personal bug-bear is that D inherited C's insane % behaviour.
> 
> I too don't like that %.
> Is this something that can be fixed in D?
> 
> Bye,
> bearophile

No, because that would mean having valid C code which has different
semantics in D.

BCS wrote:
> Short of overflow detection (and the overhead that causes) I think
> this is an issue inherent to discreet systems (a.k.a. all computer
> systems) that we just have to live with.

I was referring to what happens when you have a%b and a is negative.
Every sane language I've used ensures the result is 0<=x<b, whereas C
doesn't.

*grumbles*



More information about the Digitalmars-d mailing list