REBOL fella: 

Here is my first lesson for those who wish to do an exercise in order to
better understand REBOL. Old saying: the more practice, the better
programmer.

Write a function that performs rounding to a number at any given place.
Here are examples.

>> to-round 123.45
== 123
>> to-round 123.55
== 124
>> to-round -123.45
== -123
>> to-round/at 123.344 2
== 123.34
>> to-round 123.345 2
== 123.35
>> to-round/at 12345 -2
== 12300
>> to-round/at (1.22 // .01) 2
== 1E-2

NOTE: the last one is to answer the earlier message on this list.

Send your answer to my email at [EMAIL PROTECTED], not to this list.
I'll reply with my solution. In a couple of days or so, I'll post the
best solution with its author.

Have fun!

Geo (old professor)

Reply via email to