perlquestion
maksl
<p>dear monks;</p>
<p>i have to deal with [id://245754|numeric limits] in perl. not exactly of the size [npiazza] deals with, but i need to know my machine accuracy. it's knowledge is crucial in order to eventually trust the computed data. :)</p>
<readmore>
i've come up with this rapid one-liner:
<code>
perl -e '$eps=1;while(1<1+$eps){$eps/=2;}print "$eps\n"'
</code>
<p>please tell me if my assumption are nuts. on a debian x86 and alpha i get: 1.11022302462516e-16<br>
number that is found on various googled site in relation with the "NAG Fortran Library" and its precesion (<a href="http://www.epcc.ed.ac.uk/computing/services/cray_service/documents/local_libs/NAG/nag_t3d_usersnote.html" >example</a>).</p>
</readmore>
<p><em>e~(N)^(1/2)*eps</em><br>
where eps would be the machine accuracy.<br>N the number of multiplications.<br> e would result in the supposed mean fault</p>
<p>thx for your advice [maksl]</p>