On 7/2/07, Bruno <[EMAIL PROTECTED]> wrote:
Hey, what's wrong in this code? I'ts supposed to check if a number and it's
double contain the same digits. I tried a couple different ways of
multiplying a number by two and each way returned me a different error...

  (*/ (/:~ ": ]) = (/:~ ": 2*])) >:i.1e3
|limit error

  (*/ (/:~ ": ]) = (/:~ ": 2*]))
*/ ((/:~ ": ]) = /:~ ": 2 * ])
$ ((/:~ ": ]) = /:~ ": 2 * ]) >:i.1e3
500500

So, here, you're trying to construct a table with 1000 rows and
500500 columns.  The limit error is J telling you it's not going to
even bother trying to construct an array that large.  (I believe
you are using a 32 bit version of J.)

  (*/ (/:~ ": ]) = (/:~ ": +:])) >:i.1e3
|domain error

  (/:~":+:])>:i.3
|domain error
|       (/:~":+:])>:i.3
  (/:~ ": +:])
/:~ (": +: ])

Here, you are trying to nor a character string with a set of
integers.  The domain of nor is booleans.

I would recommend testing your expressions with smaller
arguments (where you can comfortably inspect the results).

I would also recommend testing your sub-expressions whenever
they wind up doing something you do not expect.

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

Reply via email to