Nathan Bubna wrote:
James Taylor said:

On Thu, 2003-06-26 at 18:08, Will Glass-Husain wrote:

...


For div I think we have these options
    5  \  2
    5 div  2
    div (5,2)

Another option, python uses 5 // 2 for floor division.


+1

of the suggestions so far, i like that one best.  5 \ 2 isn't bad, but 5 // 2
is more visually distinct (less likely to confuse with 5 / 2 at a glance) and
doesn't have another use.  5 div 2 is a little strange, and makes me want to
try things like 5 mod 2 instead of 5 % 2.  :)  i think it'd be better to stick
with symbols.  just my $0.02.

Here's another solution for integer division. Don't bother with it.


There is no particular need, after all:

(5/2).intValue() => 2

should give you what you want.

(You guys were thinking so hard about this that I could smell the smoke over here in Spain. Thought I should throw you guys a bone... ;-))

Cheers,

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
Check out FreeMarker's powerful new XML transformation capabilities:
http://freemarker.org/docs/xgui.html


Nathan Bubna [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to