From nobody@FreeBSD.org  Fri Nov 11 22:06:38 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E6663106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Nov 2011 22:06:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id BD6068FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Nov 2011 22:06:38 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pABM6c7Y066978
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Nov 2011 22:06:38 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id pABM6cSx066964;
	Fri, 11 Nov 2011 22:06:38 GMT
	(envelope-from nobody)
Message-Id: <201111112206.pABM6cSx066964@red.freebsd.org>
Date: Fri, 11 Nov 2011 22:06:38 GMT
From: John Smith <dcbug12345@mailinator.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: dc -e "5 3 %p 1k 5 3 %p"
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         162495
>Category:       bin
>Synopsis:       dc(1): dc -e "5 3 %p 1k 5 3 %p"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 11 22:10:05 UTC 2011
>Closed-Date:    
>Last-Modified:  Fri Nov 11 22:33:35 UTC 2011
>Originator:     John Smith
>Release:        9.0-RC1
>Organization:
John Smith Co.
>Environment:
FreeBSD foo 9.0-RC1 FreeBSD 9.0-RC1 #2: Fri Nov  4 21:50:17 EDT 2011     foo@foo:/usr/obj/usr/src/sys/MYKERNEL  i386
>Description:
/usr/src/usr.bin/dc/

%dc -e "5 3 %p 1k 5 3 %p"
2
.2

Output of the modulo operator is divided by 10(scale) when scale>0.

From what I tested the bug doesn't appear to happen in bcode.c:bmod(void), it looks like it happens some time after it is called.
>How-To-Repeat:
%dc -e "5 3 %p 1k 5 3 %p"
2
.2
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
