# HG changeset patch # User jwe # Date 832062076 0 # Node ID 24bd930153238318c573057fd99364be44cab18d # Parent c0ec4630bd31edd80f7f365ffde0c196a5dd0673 [project @ 1996-05-14 08:19:42 by jwe] diff -r c0ec4630bd31 -r 24bd93015323 src/arith-ops.cc --- a/src/arith-ops.cc Tue May 14 05:23:50 1996 +0000 +++ b/src/arith-ops.cc Tue May 14 08:21:16 1996 +0000 @@ -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++ *** diff -r c0ec4630bd31 -r 24bd93015323 src/arith-ops.h --- a/src/arith-ops.h Tue May 14 05:23:50 1996 +0000 +++ b/src/arith-ops.h Tue May 14 08:21:16 1996 +0000 @@ -89,6 +89,8 @@ const ComplexMatrix& b, tree_expression::type t); +void symbols_of_arith_ops (void); + #endif /*