I usually solve such problems by working with the
hex representation.  Thus:

   unhex=: 3!:2
   hex  =: 2&(3!:3)
   cons =: unhex @ ((}: hex 0.5)&,)
   
   ":!.18 cons (15$'0'),'1'  NB. just larger than 0
4.9406564584124654e_324
   ":!.18 cons '3fe',13$'f'  NB. just smaller than 1
0.99999999999999989
   ":!.18 cons '7fe',13$'f'  NB. largest finite positive
1.7976931348623157e308

Regarding the middle one, the following expressions
show that the answer is correct:

   ":!.18 ] 1 - cons '3fe',13$'f'
1.1102230246251565e_16
   ":!.18 ] 1 - cons '3ff',13$'0'
0



----- Original Message -----
From: bill lam <[EMAIL PROTECTED]>
Date: Tuesday, April 10, 2007 3:05 am
Subject: [Jprogramming] limit constants

> Hi all,
> 
> With respect to J's IEEE double, how to get the numbers that
> a. just larger than 0 (smallest positive number)
> b. just smaller than 1
> c. largest positive number
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to