integer division with float result

bearophile bearophileHUGS at lycos.com
Mon Nov 19 02:30:09 PST 2007


Bill Baxter:
> I think it'd be nice to have / do float division, and 
> introduce another operator (like python's //) for truncated integer 
> division.  But I think Walter is too entrenched in C-ish ways to see any 
> value in changing how it works.  Python is changing because it wants to 
> be newbie/scientist friendly above all else.  D merely wants to be 
> easier to use than C++.

Pascal uses / and div, and it's a good enough syntax.
(If operators get changed, then replacing && with and, || with or, etc (and maybe even | with OR, & with AND, etc), may be newbie friendly too. Even Python keeps those cryptic & | ~ ^ maybe because if you need them you can't be too much newbie).

Bye,
bearophile



More information about the Digitalmars-d mailing list