You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bob mcwhirter <bo...@werken.com> on 2003/03/06 23:10:36 UTC
[jexl] div
Howdy--
Jexl seems to implement 'div' as simple division, instead of
the pair with 'mod'. I'd like to correct it. Was this a design
though, for 'div' to be divison, and not the typical div operator?
-bob
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [jexl] div
Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On Friday, March 7, 2003, at 10:39 AM, bob mcwhirter wrote:
>>> Jexl seems to implement 'div' as simple division, instead of
>>> the pair with 'mod'. I'd like to correct it. Was this a design
>>> though, for 'div' to be divison, and not the typical div operator?
>>>
>>> -bob
>>
>> It's supposed to be /. There is supposed to be a pairing of / and
>> div,
>> % and mod as far as I can read the JSTL spec.
>
> Yah, the semantics of '/' seem right, in that they perform division
> where ( int / int ) yields a float.
>
> But 'div' should do real div, at least in my mind (though, I can
> understand if you're following a broken spec) and yeild an integer
> from (int div int), but it doesn't.
I have no real knowledge, but am guessing that the tokens 'div' and
'mod' are there to give people an alternative to having '/' in XML-ish
looking things.
>
> So, we have 2 ways to mod, 2 ways to divide, an 0 ways to div.
>
>> However, if you need both / and the real div, we should consider it.
>> It's a break from JSTL, something that worries me. (Although it can
>> be
>> fairly argued we aren't compatible, I am hoping to get that way...)
>
> I think division is obviously needed, but I don't know if we need
> 2 tokens to do it. Having 'div' to what most folks consider to be
> 'div' would be a Good Thing.
Then we should shoot 'mod' if we are going to break.
Hm. Would a idiv or something be sufficient? We'd have to document.
I'm going to re-read the JSTL spec to see if I messed this up.
geir
--
Geir Magnusson Jr 203-956-2604(w)
Adeptra, Inc. 203-434-2093(m)
geirm@adeptra.com 203-247-1713(m)
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [jexl] div
Posted by bob mcwhirter <bo...@werken.com>.
> > Jexl seems to implement 'div' as simple division, instead of
> > the pair with 'mod'. I'd like to correct it. Was this a design
> > though, for 'div' to be divison, and not the typical div operator?
> >
> > -bob
>
> It's supposed to be /. There is supposed to be a pairing of / and div,
> % and mod as far as I can read the JSTL spec.
Yah, the semantics of '/' seem right, in that they perform division
where ( int / int ) yields a float.
But 'div' should do real div, at least in my mind (though, I can
understand if you're following a broken spec) and yeild an integer
from (int div int), but it doesn't.
So, we have 2 ways to mod, 2 ways to divide, an 0 ways to div.
> However, if you need both / and the real div, we should consider it.
> It's a break from JSTL, something that worries me. (Although it can be
> fairly argued we aren't compatible, I am hoping to get that way...)
I think division is obviously needed, but I don't know if we need
2 tokens to do it. Having 'div' to what most folks consider to be
'div' would be a Good Thing.
-bob
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [jexl] div
Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On Thursday, March 6, 2003, at 05:10 PM, bob mcwhirter wrote:
>
> Howdy--
>
> Jexl seems to implement 'div' as simple division, instead of
> the pair with 'mod'. I'd like to correct it. Was this a design
> though, for 'div' to be divison, and not the typical div operator?
>
> -bob
It's supposed to be /. There is supposed to be a pairing of / and div,
% and mod as far as I can read the JSTL spec.
However, if you need both / and the real div, we should consider it.
It's a break from JSTL, something that worries me. (Although it can be
fairly argued we aren't compatible, I am hoping to get that way...)
geir
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
--
Geir Magnusson Jr 203-956-2604(w)
Adeptra, Inc. 203-434-2093(m)
geirm@adeptra.com 203-247-1713(m)
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org