Hi Claude, Thanks for the thought, and appreciate your input.
I think making 5 / 2 == 2 is a big mistake. It may make sense to programmers. But the whole rationale behind this patch is that the typical template designer is not a programmer, and makes no distinction between 5 and 5.0. Dividing 5 by 2 should always equal 2.5, unless the writer goes out of their way to specify the result should be an integer. Best, WILL ----- Original Message ----- From: "Claude Brisson" <[EMAIL PROTECTED]> To: "Velocity Developers List" <[EMAIL PROTECTED]> Sent: Tuesday, July 01, 2003 8:56 AM Subject: Re: Velocity Numerics [PATCH] > > Nathan Bubna wrote : > > it would also be nice for maintaining some semblance of backward > > compatibility. there was integer division before; there's no good reason to > > stop having one now. also, it's an easier change to just switch from: > > > > #set( $foo = 5 / 2 ) to #set( $foo = 5 // 2 ) than to bother w/ intValue() > > > > Another proposal to consider, that goes in the sense of backward compatibility (fully bc in fact) : > > Only use '/', and make an integer division when implied numbers are both integers, floating point division otherwise. > > Afterwards, intValue() and floatValue() can be used in some special cases : when you need a float result from two integers, or when > you need an integer result from two floats. But the default behaviour covers a wide percentage of standard cases. > > One good point (but not a real argument, I know) is that java developers won't be surprised. > > Yes I know, it is not very convenient to code this with the current implementation of the patch, since (if I understood well) all > numbers are converted to BigIntegers beforehand. But it is not a real argument either :-) > > CloD > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
