POV-Ray : Newsgroups : povray.advanced-users : Max-value with function int() : Re: Max-value with function int() Server Time
29 Jul 2024 06:25:14 EDT (-0400)
  Re: Max-value with function int()  
From: Warp
Date: 20 May 2003 21:44:38
Message: <3ecada06@news.povray.org>
Jaap Frank <jjf### [at] xs4allnl> wrote:
> The first three numbers below exceed the max-value 2 147 483 647 for div() and
> mod().
>> N(11 117 333 955)N(4 254 934 330)N(3 900 569 407)N(7 382 340)N(3358)N(970)}//  -
> Warp -
> Haven't this give you troubles?

  Nope. By chance, not because I knew how to avoid it.

  mod() doesn't matter because it only takes the least-significant values
of the number. If the most-significant are lost in a double->int conversion,
that doesn't affect the value of mod.

  As for div(), I suppose that what the POV-Ray source code is doing is
something like "int(a/b)" (instead of "floor(a/b)" as it really should).
That is, the division is done first, and the conversion to int only to the
result. Since for example 11117333955/13 = 855179535, which is well
inside the 31-bit range of int, the result is (luckily) not cut.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

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