[REBOL] Re: percent! - new datatype request
From: anton:lexicon at: 7-Jun-2002 14:12
Yeah, look - we're arguing already. :)
But, I remember, to be consistent, shouldn't
the second datatype be converted to the first
before the operation takes place ?
So,
100 - 50% == 50 ; as first stated
I suppose
50% - 100 == -50% ; ? or should be illegal?
And
50% * 100 == 5000%
100 * 50% == 50
> > And with it you could do something like:
> >
> > >> 100 - 50%
> > == 50
> > >> 100 + 50%
> > == 150
> > >> 100 * 50%
> > == 5000
>
> Shouldn't that be
>
> >> 100 - 50%
> == 50%
> >> 100 + 50%
> == 150%
> >> 100 * 50%
> == 5000%
>
> and thus
>
> >> rate: 8.25%
> == 8.25%
> >> price: $100.00
> == $100.00
> >> tax: price * rate
> == $8.25
>
> >> taxrate: to-percent [$8.25 / $100]
> == 8.25%
>
> ?? ./Jason
Uh oh, so to-percent involves an implicit multiplication
by 100, then? Looks nice, though.
Anton.