Yes, you are right. I'm on 32-bit machine at the moment. Using extended precision gives me the correct result.
> Date: Tue, 3 Jun 2014 11:34:57 -0400 > From: [email protected] > To: [email protected] > Subject: Re: [Jprogramming] Argument size limit for p: and q: > > Jon Hough wrote: > > It seems J did not want to handle > > q: 9999999999999999 > > 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 > > That's not a limit on q: or p: specifically; numeric literals greater than > 2^32 (or 2^64, if you're on a 64-bit machine) are interpreted as IEEE > double-precision floating-point values, which can hold small numbers to > great precision, or large numbers to small precision, but not large > numbers to large precision. > > More specifically, at some point, integers with distinct string > representations are mapped to the same floating-point value. I can't > reproduce your exact problem on my 64-bit machine (which produces 3 3 11 > 17 73 101 137 5882353, as you'd expect), but I bet if you just typed bare > 9999999999999999 into the session manager, you'd see something like 1e16 > (note the scientific notation, indicating the value is interally > represented with a floating point number), whose prime-decomposition is, > indeed, */ 2 5^16, as q: reports. > > In order to represent 9999999999999999 exactly on your 32-bit machine, you > need to use extended precision notation: 9999999999999999x . Not that > x:9999999999999999 will NOT work, for the very same reason > q:9999999999999999 doesn't work. > > -Dan > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
