POV-Ray : Newsgroups : povray.binaries.images : Strange behaviour of mod() : Strange behaviour of mod() Server Time
7 Oct 2024 06:40:41 EDT (-0400)
  Strange behaviour of mod()  
From: Jörg "Yadgar" Bleimann
Date: 20 Sep 2024 22:21:27
Message: <66ee2da7$1@news.povray.org>
Hi(gh)!

For generating a time display for my current attempt at a Satisfactory 
1.0 speedrun, I use the following code:

#declare hours=div(clock,90000);
#declare minutes=mod(div(clock,1500),60);
#declare seconds=mod(div(clock,25),60);
#declare centiseconds=mod(clock,25)*4;

and the text object is built like:

concat(str(hours,-2,0),":",str(minutes,-2,0),"'",str(seconds,-2,0),",",str(centiseconds,-2,0)),0.001,0

But whenever the clock value is divisible by 25 without remainder, I get 
"100" instead of "00" for the centiseconds part of the timestamp. Why?

See you in Khyberspace!

Yadgar

-- 
VBI BENE, IBI BACTRIA!


Post a reply to this message

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