signed / unsigned oddity

Henning Hasemann hhasemann at web.de
Wed Feb 7 13:11:48 PST 2007


Is this a bug or did I misunderstood arithmetic or cast()?

cast(int)(-5 * 1 * 0.41));  // result: -2
cast(int)(-5 * 1u);         // result: -5
cast(int)(-5 * 1u * 0.41)); // result: 1760936589

The last result seems strange to me. I use dmd 1.005.

Henning



More information about the Digitalmars-d mailing list