Dan Bron wrote:
> 
> Viktor Cerovski provided:
>>  dlamch  determines double precision machine parameters.
> 
> Can this be used to determine the smallest positive integer not
> representable in the machine?  
> 
>          (= >:) 1e13
>       0
> 
>          (= >:) 1e14
>       1
> 
> but where is the cutoff?    More generally, where is the cutoff for a
> given power of 10 (or N)?
> 
> -Dan
> 
1/epsilon would be an approximate value of such an integer.  More 
precisely, if you have M-bits of mantissa, your integer should be 2^M .
For example, eps for 53 bits of mantissa is approx 1e_16:

   2^_53
1.110223025e_16

Since dlamch reports that it sees 53 bits, that means your integer 
should be somewhere near 1e16.  But it is not according to the test!

After some trying I've got:

   two=:1%0.5

   (= >:)two^43
0
   (= >:)two^44
1
   two^44
1.759218604e13

It seems that we have only 43 bits in mantissa here. 

The same test in Common LISP:

$ clisp -q
[1]> (defun test(x)(=(- x 1.0d0)x))
TEST
[2]> (test(expt 2.0d0 53))
NIL
[3]> (test(expt 2.0d0 54))
T

-- 
View this message in context: 
http://www.nabble.com/Format-fractional-hexadecimal-tf4895825s24193.html#a14079673
Sent from the J Programming mailing list archive at Nabble.com.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to