POV-Ray : Newsgroups : povray.advanced-users : Round function : Round function Server Time
5 Jul 2024 14:30:59 EDT (-0400)
  Round function  
From: Woody
Date: 13 Nov 2007 12:55:00
Message: <web.4739e4827567ddbb94e61a50@news.povray.org>
Can someone help me,

I am trying to create a round(a,b) function. i.e something to take float a and
round it to b decimal places or round it to the nearest b

I need to be able to use it in an isosurface object as say

isosurface{
function{abs(x-round(x,0))}
}

where round(x,0) rounds to 0 decimal places.

I tried a macro like

#macro round(a,b)
val(str(a,64,b)
#end

pov doesnt handle the promotion properly

is there anyway I can construct a function to achieve the same effect?


Post a reply to this message

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