[Jprogramming] rosettacode

Jose Mario Quintana jose.mario.quintana at gmail.com
Mon May 6 23:27:47 UTC 2013


While writing a tacit version for this continued fraction task I noticed
the ending comment:

"convince yourself that, in the same way as 3.7 may be represented as
3.70when an extra decimal place is required,
[3;7] may be represented as [image: [3;7,\infty]] when an extra term is
required"

J knows that:

   3 7 =&((+ %)/) 3 7 _
1
I am careful when dealing with  _ but in this case (as in many other
cases) J's handling of _ makes a lot of sense; I did not see anything
similar in any of the other implementations.

By the way, for _151r77 J and Tcl reported a different
representation versus the other languages reported representation;
apparently both representations are valid:

   _2 25 1 2x ,&((+ %)/) _1 _1 _24 _1 _2x
_151r77 _151r77



On Thu, Apr 18, 2013 at 11:19 PM, David Ward Lambert <b49P23TIvg at stny.rr.com
> wrote:

> Please modify these new entries as you please:
> http://rosettacode.org/wiki/Josephus_problem#J
>
> http://rosettacode.org/wiki/Continued_fraction/Arithmetic/Construct_from_rational_number#J
> The continued fraction solution has some oddities.  Returning _ to
> signal "finished" converts the output vector to floating point.  That's
> why I excluded the 314285714 100000000x example.  The `y is 8' input to
> r2cf__CF is arbitrary and I have to strip it with _ from the output
> vector.
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


More information about the Programming mailing list