POV-Ray : Newsgroups : povray.general : large numbers turn random negative!? : large numbers turn random negative!? Server Time
20 May 2024 17:15:10 EDT (-0400)
  large numbers turn random negative!?  
From: Leroy
Date: 24 Jul 2023 14:30:00
Message: <web.64bec2382d0df701b457f86cf712fc00@news.povray.org>
I have pov3.7 on my winXP.
While playing around with making music using POV. I made long rhythm strings
and turn them into numbers and visa versa. Using random numbers to check things
out, when negative random numbers show up. With NO negative numbers on the page.
It's not a big deal in my case. But I wonder if this is a window thing, or a
float thing in POV,and if anyone else came a cross this.

Here's the test code the should show the problem:

#declare Cm=pow(2,40); #debug concat("Cm =",str(Cm,0,0),"\n")
#declare Cv=Cm-1;       #debug concat("Cv =",str(Cv,0,0),"\n")
#declare S=seed(423);
#declare Mv=int(rand(S)*Cv); #debug concat("Mv =",str(Mv,0,0),"\n")
text{ttf "arial.ttf" concat("Mv=",str(Mv,0,0)) 0.4,0 scale 1 translate
<-4,1.5,0> pigment{rgb 1}}

 light_source{<0,0,-20>  rgb 1}
camera {
  orthographic
  location <0,0,-10>    // position & direction of view
  look_at  <0,0,0>
  right 10*x            // horizontal size of view
  up 10*y               // vertical size of view
}

Have Fun!


Post a reply to this message

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