POV-Ray : Newsgroups : povray.beta-test : Doc Error for mod? : Re: Doc Error for mod? (nevermind me) Server Time
30 Jul 2024 10:22:53 EDT (-0400)
  Re: Doc Error for mod? (nevermind me)  
From: Bob H 
Date: 23 Nov 2001 08:49:51
Message: <3bfe53ff@news.povray.org>
"Bob H." <omn### [at] msncom> wrote in message
news:3bfe4c10@news.povray.org...
> "Tom Melly" <tom### [at] tomandlucouk> wrote in message
> news:3bfe2478@news.povray.org...
> > The docs refer to mod(A, B) as:
> > Formula is mod=((A/B)-int(A/B))*B
> >
> > Shouldn't that be:
> > Formula is mod=A-(int(A/B)*B)
>
> Not that I'd know or anything but I thought:  mod=A/B-int(A/B)
> For instance, if A=3 and B=2 that would get you the modulus 0.5; so long
as
> int() rounds down anyway.

Well, chalk another lesson up for me.  One of those obscure mathematical
things to me, I always think modulus gets you just a (decimal) remainder
after division.  Looking it up I see it could be a whole number or at least
1 anyhow.  Still, seems that if you do either the Doc formula or yours, Tom,
that it comes out the same.  Just I'm not not %100 sure.

In fact what I said is probably, simply put, a "remainder" only whereas
modulus is another matter.  So please excuse my ignorance.  Thank you  :-)

Bob H.


Post a reply to this message

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