From 8f57e1bff5634dfc91f225293e4b357660931a1b Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Thu, 8 Mar 2012 08:15:38 +0000 Subject: let length(0.000) conform to what gnu bc does; from AIDA Shinra --- usr.bin/dc/bcode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/dc/bcode.c b/usr.bin/dc/bcode.c index b8a46f2f3d8..5a63b9de05e 100644 --- a/usr.bin/dc/bcode.c +++ b/usr.bin/dc/bcode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcode.c,v 1.41 2010/05/15 10:59:29 otto Exp $ */ +/* $OpenBSD: bcode.c,v 1.42 2012/03/08 08:15:37 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -682,7 +682,7 @@ count_digits(const struct number *n) u_int i; if (BN_is_zero(n->number)) - return 1; + return n->scale ? n->scale : 1; int_part = new_number(); fract_part = new_number(); -- cgit v1.2.3