If you are talking about stuff like this: 1 + 2e_308 - 1 0
please keep in mind that you should not assume your numbers have more than 15 digits of accuracy. Usually not even that much (though we have extended precision numbers - with their associated penalties - if you want to work with them). And, subtraction's accuracy is based on the accuracy of the largest number involved. (That said, 2e_308 is special because that's right about where the number representation starts to lose that 15 digits of accuracy. You'd need 308 leading zeros, to represent the number exactly, of course - but the problem is that the fixed width representation only has 11 bits for the exponent of the number.) This issue, by the way, is not unique to J - every programming language has to deal with this in some fashion. Thanks, -- Raul On Sat, Oct 7, 2017 at 7:24 PM, 'Skip Cave' via Beta <[email protected]> wrote: > It would be marvelous if J was polite enough to warn me when a result is in > all likelihood not correct, rather than blithely returning an egregiously > wrong answer. > > Skip > > <<<>>> > > x:1.9 % 2^1024 > > 0 > > 1.9 %&x: 2^1024 > > 0 > > 1.9 % 2^1024x > > |domain error > > | 1.9 %2^1024 > > > 1.9 %&x: 2^1024x > > 19r179769313486231590772930519078902473361797697894230657273 > 430081157732675805500963132708477322407536021120113879871393 > 357658789768814416622492847430639474124377767893424865485276 > 302219601246094119453082952085005768838150682342462881473913 > 1105408272371633... > > > Skip Cave > Cave Consulting LLC > > On Sat, Oct 7, 2017 at 12:24 PM, Skip Cave <[email protected]> wrote: > >> 1.9 %&x: 2^1024x >> >> 19r179769313486231590772930519078902473361797697894230657273 >> 430081157732675805500963132708477322407536021120113879871393 >> 357658789768814416622492847430639474124377767893424865485276 >> 302219601246094119453082952085005768838150682342462881473913 >> 1105408272371633... >> >> x:1.9 % 2^1024 >> >> 0 >> >> 1.9 %&x: 2^1024 >> >> 0 >> >> 1.9 % 2^1024x >> >> |domain error >> >> | 1.9 %2^1024 >> >> >> Engine: j805/j64/windows >> >> Release: commerciai/2016-12-11T08:02:16 >> >> Library: 8.05.14 >> >> Qt IDE: 1.5.4/5.6.2 >> >> Platform: Win 64 >> >> Installer: J805 install >> >> lnstaiiPath: c:/program files/j64 -805 >> >> >> >> Skip Cave >> Cave Consulting LLC >> >> On Sat, Oct 7, 2017 at 10:57 AM, Skip Cave <[email protected]> >> wrote: >> >>> Doesn't happen on my system: >>> >>> 1.9 %&x: 2^1024x >>> >>> 19r179769313486231590772930519078902473361797697894230657273 >>> 430081157732675805500963132708477322407536021120113879871393 >>> 357658789768814416622492847430639474124377767893424865485276 >>> 302219601246094119453082952085005768838150682342462881473913 >>> 1105408272371633... >>> >>> >>> Engine: j805/j64/windows >>> >>> Release: commerciai/2016-12-11T08:02:16 >>> >>> Library: 8.05.14 >>> >>> Qt IDE: 1.5.4/5.6.2 >>> >>> Platform: Win 64 >>> >>> Installer: J805 install >>> >>> lnstaiiPath: c:/program files/j64 -805 >>> >>> >>> >>> Skip Cave >>> Cave Consulting LLC >>> >>> On Sat, Oct 7, 2017 at 10:05 AM, 'Pascal Jasmin' via Beta < >>> [email protected]> wrote: >>> >>>> >>>> >>>> this happens in 805 too, >>>> >>>> 1.9 %&x: 2^1024x >>>> >>>> >>>> >>>> ________________________________ >>>> From: Raul Miller <[email protected]> >>>> To: Beta forum <[email protected]> >>>> Sent: Saturday, October 7, 2017 8:56 AM >>>> Subject: [Jbeta] Do I need to upgrade? >>>> >>>> >>>> >>>> I was expecting a zero or a small value from this expression - >>>> >>>> instead, I got an error. >>>> >>>> >>>> 1.9%2^1024x >>>> >>>> |domain error >>>> >>>> JVERSION >>>> >>>> Engine: j806/j64/darwin >>>> >>>> Beta-6: commercial/2017-09-26T14:12:52 >>>> >>>> Library: 8.06.07 >>>> >>>> Qt IDE: 1.6.1/5.6.3 >>>> >>>> Platform: Darwin 64 >>>> >>>> Installer: J806 install >>>> >>>> InstallPath: /users/rauldmiller/applications/j64-806 >>>> >>>> Contact: www.jsoftware.com >>>> >>>> >>>> (I was trying to investigate the representation of denormalized numbers.) >>>> >>>> >>>> Thanks, >>>> >>>> >>>> -- >>>> >>>> Raul >>>> >>>> ---------------------------------------------------------------------- >>>> >>>> For information about J forums see http://www.jsoftware.com/forums.htm >>>> ---------------------------------------------------------------------- >>>> For information about J forums see http://www.jsoftware.com/forums.htm >>>> >>> >>> >> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
