metaeducation / rebol-issues

6 stars 1 forks source link

One should be able to take a percentage of a time! value #1391

Open rebolbot opened 14 years ago

rebolbot commented 14 years ago

Submitted by: meijeru

The MULTIPLY function and the * operator take two scalar! arguments. If one of them is a percent! value, the other one cannot be a time! value, which is not very consistent since one CAN take a percentage of all other scalar quantities, including a tuple! value (individual components are computed, then rounded down) and a char! value (converted to integer! first -- see code).

>> 50% * 1.2.3.4
== 0.1.1.2
>> 50% * #"a"
== 48.5 ;; half of 97
>> 50% * 10:00
** error ;; would have expected same result as 0.5 * 10:00, namely 5:00

CC - Data [ Version: alpha 95 Type: Wish Platform: All Category: Math Reproduce: Always Fixed-in:none ]

rebolbot commented 14 years ago

Submitted by: meijeru

I note that this was already covered by ticket #98, and it was dismissed at the time ("doesn't seem useful"). I would argue that consistency (why make exceptions) is a more cogent argument than usefulness (who knows what user will find an application).