Raul wrote:
>  but I wonder if you have thought through
>  the implications of your requirements for extended precision
>  results?

The hurdle occurred to me.  And I came up with some ideas, but I did
not want to be too prescriptive; I am hoping to leverage the community's
creativity.  I envisioned an iterative process to resolve such issues.
(What fun is a competition with no action?)

But, if it helps, the ideas I had were:

        (1)  For values that are extended but could be represented by
             non-negative decimal integers (n <: <: 2^<:word_size), just
             prefix an x: , as in 'x:1234' -: pc_xxx '1234x'  .

        (2)  For values that don't fit into machine words, then
             something like:
                (a)  ' 10 #. x: '0123456789' i. ''9999999999999999'' '
                     -: pc_xxx '9999999999999999x'  .
                        (i)  One benefit of this format is it's
                             generalizable to all integral values, not
                             just extended ones (i.e. for normal
                             integers, elide the x:  ).

                (b)  or maybe ' 10 #. x: 9 9 9 9 9 9 9 9 9 ... '.

                (c)  or maybe put the x: on the left instead, as in
                     (x:10) #. 9 9 9 9 9 ... .

                (d)  These considerations also apply to large floating
                     point values, too, as in 99999999999999999999 (i.e.
                     no trailing x, resulting in a FP instead of an
                     int).

        (3)  For rationals, I can't decide if  (x:p) % (x:q:)  is more
             readable than  p %&x: q  but my gut says choose the former
             (unless there's some clearer expression I'm not thinking
             of).

Other ideas welcome (encouraged!).

-Dan



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

Reply via email to