• The NumericEventHandler, sometimes it works, sometimes it does not.

    From Peter Luschny@21:1/5 to All on Thu Jan 18 05:12:04 2018
    restart;
    ln(0);
    tan(Pi/2);

    Error, (in ln) numeric exception: division by zero
    Error, (in tan) numeric exception: division by zero

    # Now we replace the NumericEventHandler for division by zero. NumericEventHandler(division_by_zero = proc(operator,operands,defVal) -infinity end):

    ln(0);
    tan(Pi/2);

    -infinity
    -infinity

    # So far so good. Now define

    restart;
    gammaquot := (n, k) -> limit(GAMMA(n+1+x)/(GAMMA(k+1)*GAMMA(n-k+1+x)), x=0); gammaquot(-1,-1);
    Error, (in GAMMA) numeric exception: division by zero

    restart;
    NumericEventHandler(division_by_zero = proc(operator,operands,defVal) -infinity end):
    gammaquot := (n, k) -> limit(GAMMA(n+1+x)/(GAMMA(k+1)*GAMMA(n-k+1+x)), x=0); gammaquot(-1,-1);

    0

    # Q1: Why is the NumericEventHandler not used here?
    # Q2: What is the correct value of gammaquot(-1,-1)?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From asetofsymbols@gmail.com@21:1/5 to All on Mon Jan 22 00:50:24 2018
    I don't know Maple language, but for me "exceptions handle" can not be used on all different of catch few 1 or 2 type of error(write out memory reserved and don't know other) error

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)