POV-Ray : Newsgroups : povray.general : Round to nearest integer : Re: Round to nearest integer Server Time
25 Apr 2024 01:33:40 EDT (-0400)
  Re: Round to nearest integer  
From: clipka
Date: 27 May 2021 09:17:26
Message: <60af9be6@news.povray.org>
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`.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.