If I understand correctly, you meant J should raise an
domain (or other type) error and abort execution. But since
J does not look ahead, it can not know the overflow that
promoting integer to float would cause wrong answer in the
next step. We can implement different rules for integer
overflow.
1. promote to float
2. promote to extended integer
3. ignore overflow (wrapping round)
4. raise an error

1 (current behavior) is what most of us expected
2 more suitable for solving problems in Euler project.
3 is excellent for speed efficiency
4 might be what you wanted

Сб, 07 окт 2017, JBeta написал(а):
> Bill Lam asked:
> 
> What is your expected result for the case you quoted?
> 
> The problem is:
> 
>     13 | */ 13 | 10 # 19 29 59 79 89 109 119 139 149 179 199
> 0
> 
> Which is the wrong answer. However, there is no indication that anything
> went wrong,
> Since no error notification occurred,  I would reasonably assume that I
> have the right answer.
> Actually, the result in this case should *not* be zero. It should be
> something like:
> "floating point overflow occurred", or "numeric value out of bounds"
> 
> That would tell me that I need to do something like - try extended integers:
> 
>        13 | */ 13 | 10 # 19 29 59 79 89 109 119 139 149 179 199x
> 
> 9
> 
> Which is the right answer.
> 
> Skip
> 
> Skip Cave
> Cave Consulting LLC
> 
> On Sat, Oct 7, 2017 at 7:42 PM, bill lam <[email protected]> wrote:
> 
> > I don't understand what is "J would warn you". Either a J sentence executed
> > successfully or it raise an error exception. There is nothing in between.
> > What is your expected result for the case you quoted?
> >
> > On Oct 8, 2017 8:34 AM, "'Skip Cave' via Beta" <[email protected]> wrote:
> >
> > ​​
> > Those examples weren't very good. Here's a better example of "blithely
> > returning an egregiously wrong answer".
> >
> >     13 | */ 13 | 10 # 19 29 59 79 89 109 119 139 149 179 199
> > 0
> >
> > That answer is not correct. Here's the correct answer:
> >
> >        13 | */ 13 | 10 # 19 29 59 79 89 109 119 139 149 179 199x
> >
> > 9
> >
> > It would be nice if J would warn you when you get underflow or overflow in
> > the middle of a computation. Perhaps by inserting infinity, NaN. or some
> > other mechanism in that faulty result. The marker would need to propagate
> > unmodified through subsequent computations. Then if that marker showed up
> > in the final result, I would know that something got out of bounds during
> > the computation.
> >
> > Skip
> >
> > Skip
> >
> >
> > Skip Cave
> > Cave Consulting LLC
> >
> > On Sat, Oct 7, 2017 at 6:38 PM, Henry Rich <[email protected]> wrote:
> >
> > > They all look ok to me.
> > >
> > > Henry Rich
> > >
> > > On Oct 7, 2017 19:25, "'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
> > >
> > ----------------------------------------------------------------------
> > 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

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to