POV-Ray : Newsgroups : povray.newusers : mod() and floating point division woes. :( : mod() and floating point division woes. :( Server Time
13 Aug 2022 14:02:13 EDT (-0400)
  mod() and floating point division woes. :(  
From: Bald Eagle
Date: 2 Sep 2018 20:30:00
Message: <web.5b8c7fd64b23d33b458c7afe0@news.povray.org>
So....

I _just_ want to use mod (N, 0.1) in a loop of #for(N, 0, 1, 0.02).

What's a good reliable way to implement an fmod() equivalent?
Do I need to write a macro, or is there a straightforward function (){} that I
can use?

Sorry to be grappling with "computer science math" again.
Thus, I return to the newusers section.  :|

Some of the values I get are "0", others are "0.1".
I'm challenged by the wide disparity between the two possibilities, and can't
get anything to work reliably, especially when I try to use the mod(A, B) result
in a select () statement.


Post a reply to this message

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