Dividing times...
[1/4] from: carl:cybercraft at: 9-Jan-2003 16:41
REBOL's none too precise when it comes to dividing times...
>> 0:00:59 / 0:00:15
== 3
>> 0:00:59 / 0:00:14
== 4
since it returns an integer...
>> type? 0:00:59 / 0:00:14
== integer!
Obviously we can do something like this...
>> t1: 0:00:59 t2: 0:00:15
== 0:00:15
>> (t1/1 * 3600 + (t1/2 * 60) + t1/3) / (t2/1 * 3600 + (t2/2 * 60) +
t2/3)
== 3.9333333333333
but is there a better way?
--
Carl Read
[2/4] from: greggirwin::mindspring::com at: 8-Jan-2003 21:13
Hi Carl,
>>> t1: 0:00:59 t2: 0:00:15
CR> == 0:00:15
>>> (t1/1 * 3600 + (t1/2 * 60) + t1/3) / (t2/1 * 3600 + (t2/2 * 60) +
CR> t2/3)
CR> == 3.9333333333333
CR> but is there a better way?
I don't know about better but...
>> 0:00:59 / to integer! 0:0:15
== 0:00:03.933333333
-- Gregg
[3/4] from: g:santilli:tiscalinet:it at: 9-Jan-2003 11:28
Hi Carl,
On Thursday, January 9, 2003, 4:41:31 AM, you wrote:
CR> but is there a better way?
>> (to-decimal 0:00:59) / to-decimal 0:00:15
== 3.93333333333333
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[4/4] from: carl:cybercraft at: 9-Jan-2003 23:30
On 09-Jan-03, Gregg Irwin wrote:
> Hi Carl,
>>>> t1: 0:00:59 t2: 0:00:15
<<quoted lines omitted: 6>>
>>> 0:00:59 / to integer! 0:0:15
> == 0:00:03.933333333
Ah - thanks Gregg. Put me on the right track, and the following /is/
a better way...
>> to decimal! 0:00:59 / to decimal! 0:0:15
== 3.933333333
--
Carl Read
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted