POV-Ray : Newsgroups : povray.general : (cos(pi/2)>0) and (cos(pi/2)=0) are both true Server Time
1 Nov 2024 02:20:37 EDT (-0400)
  (cos(pi/2)>0) and (cos(pi/2)=0) are both true (Message 1 to 5 of 5)  
From: Didier
Subject: (cos(pi/2)>0) and (cos(pi/2)=0) are both true
Date: 26 Sep 2000 20:04:03
Message: <39d13973$1@news.povray.org>
When running the following code, I get 2 spheres. I expected only one.
I use pov v3.1g on Windows98, P350, 128Mo.
A pov bug ? A windows bug?  Is floating-point math that not  precise ?

// ----------------------------------------

camera
{
  location  <0.0, 0.5, -4.0>
  direction 1.5*z
  right     4/3*x
  look_at   <0.0, 0.0,  0.0>
}

light_source
{
  0*x
  color White
  translate <-30, 30, -30>
}


#if (cos(pi/2)>0)
  sphere { 0.0, 1
    pigment {Yellow}
    translate x
    }
#end

#if (cos(pi/2)=0)
  sphere { 0.0, 1
    pigment {Green}
    translate -x
    }
#end


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: (cos(pi/2)>0) and (cos(pi/2)=0) are both true
Date: 26 Sep 2000 21:44:52
Message: <39d15114$1@news.povray.org>
In article <39d13973$1@news.povray.org> , "Didier" <did### [at] cybercablefr>
wrote:

>  Is floating-point math that not  precise ?

You got the point.


      Thorsten


Post a reply to this message

From: Warp
Subject: Re: (cos(pi/2)>0) and (cos(pi/2)=0) are both true
Date: 27 Sep 2000 07:08:19
Message: <39d1d511@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
: You got the point.

  Shouldn't the epsilon value be the same for = and for > thus making them
unique?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: (cos(pi/2)>0) and (cos(pi/2)=0) are both true
Date: 27 Sep 2000 11:51:58
Message: <39d2179e$1@news.povray.org>
In article <39d1d511@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>   Shouldn't the epsilon value be the same for = and for > thus making them
> unique?

See "(X <= D) is not equal ((X<D) | (X=D))" in povray.bugreports.


    Thorsten


Post a reply to this message

From: Didier
Subject: Re: (cos(pi/2)>0) and (cos(pi/2)=0) are both true
Date: 27 Sep 2000 17:50:11
Message: <39d26b93$1@news.povray.org>
Thank you, I found a work around

#if ((cos(pi/2)>0) & (cos(pi/2)!=0))
  sphere { 0.0, 1
    pigment {Yellow}
    translate x
    }
#end

#if (cos(pi/2)=0)
  sphere { 0.0, 1
    pigment {Green}
    translate -x
    }
#end


39d2179e$1@news.povray.org...
> In article <39d1d511@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:
>
> >   Shouldn't the epsilon value be the same for = and for > thus making
them
> > unique?
>
> See "(X <= D) is not equal ((X<D) | (X=D))" in povray.bugreports.
>
>
>     Thorsten


Post a reply to this message

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