-.TH NR-DIVZERO 1 "October 19, 2014" OpenBSD
+.TH NR-DIVZERO 1 "December 18, 2014" OpenBSD
.SH NAME
nr-divzero \- division by zero in numerical expression
.SH DESCRIPTION
initial text
-.nr result 1/0
-final \n[result] text
+.nr divresult 1/0
+.nr modresult 1%0
+final \n[divresult] \n[modresult] text
nr-divzero - division by zero in numerical expression
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
- initial text final 0 text
+ initial text final 0 0 text
-OpenBSD October 19, 2014 NR-DIVZERO(1)
+OpenBSD December 18, 2014 NR-DIVZERO(1)
-/* $OpenBSD: roff.c,v 1.115 2014/12/16 23:44:16 schwarze Exp $ */
+/* $OpenBSD: roff.c,v 1.116 2014/12/18 17:43:07 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
*res *= operand2;
break;
case '/':
- if (0 == operand2) {
+ if (operand2 == 0) {
mandoc_msg(MANDOCERR_DIVZERO,
r->parse, ln, *pos, v);
*res = 0;
*res /= operand2;
break;
case '%':
+ if (operand2 == 0) {
+ mandoc_msg(MANDOCERR_DIVZERO,
+ r->parse, ln, *pos, v);
+ *res = 0;
+ break;
+ }
*res %= operand2;
break;
case '<':