|
|
On 5/27/2021 9:17 AM, clipka wrote:
> Am 27.05.2021 um 13:31 schrieb Mike Horvath:
>>> Has someone written a macro that rounds a float to the nearest
>>> integer? Thanks!
> ...
>> Or, to the nearest multiple of n, where n is any number.
>
> try `floor(FOO / N + 0.5) * N`.
I found this on web and adapted it to POV:
#macro round(number, base)
(((number + base/2) / base) * base)
#end
Not sure which of the two is preferable.
Mike
Post a reply to this message
|
|