well need to calculate A/B
well the units are: The rest of
C0 = int (A/B) .................... R0 = A - C0 * B
the first decimal is
C1 = int ( (A - B * C0 ) *10 / B ) ......... C1 = int ( R0*10 / B)
............. R1 = R0*10 - C1*B
C2 = int ( R1 * 10 / B )
Cn= int ( 10 * R(n-1) / B) .................... Rn = 10*R(n-1) - Cn*B
Exemple: 7 / 11
C0 = 0 R0 = 7
C1 = int (70/11) = 6 R1= 70-6*11 = 4
C2 = int (40/11) = 3 R2 = 7
C3 = 70/11 = 6 R3 = 4
C4 = 40/11 = 3 R4 = 7
etc ... with a loop willbe easy
so 7 / 11 = 0.6309
hope this will help you ....
web.46e41787bca8f08494e61a50@news.povray.org...
> Does anybody know of a way, short of modifying the sourcecode, to increase
> the numerical precision that pov ray uses.
>
> For example say I need to calculate 1/3 to the 100th decimal place. I
> believe it goes upto maybe the 8th or sixteenth place?
>
> Is there some ini option that can do this?
>
> What about declaring the value as you want it.
> i.e. instead of writing
> #declcare my_var = 1/3;
>
> declare it as
> #declare my_var = 0.333333333333333333333333333333333333333333333333333;
>
> Would this do anything or would it truncate after a certain decimal spot?
>
>
Post a reply to this message
|