Mercurial > hg > octave-jordi
changeset 2191:24bd93015323
[project @ 1996-05-14 08:19:42 by jwe]
author | jwe |
---|---|
date | Tue, 14 May 1996 08:21:16 +0000 |
parents | c0ec4630bd31 |
children | 55d26c741516 |
files | src/arith-ops.cc src/arith-ops.h |
diffstat | 2 files changed, 21 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/arith-ops.cc +++ b/src/arith-ops.cc @@ -40,10 +40,13 @@ #include "xdiv.h" #include "xpow.h" +// Allow divide by zero errors to be suppressed. +static bool Vwarn_divide_by_zero; + #define DIVIDE_BY_ZERO_ERROR \ do \ { \ - if (user_pref.warn_divide_by_zero) \ + if (Vwarn_divide_by_zero) \ warning ("division by zero"); \ } \ while (0) @@ -2813,6 +2816,21 @@ return octave_value (complex_result); } +static int +warn_divide_by_zero (void) +{ + Vwarn_divide_by_zero = check_preference ("warn_divide_by_zero"); + + return 0; +} + +void +symbols_of_arith_ops (void) +{ + DEFVAR (warn_divide_by_zero, 1.0, 0, warn_divide_by_zero, + "If TRUE, warn about division by zero"); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***