diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2012-03-08 08:15:38 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2012-03-08 08:15:38 +0000 |
commit | 8f57e1bff5634dfc91f225293e4b357660931a1b (patch) | |
tree | 939b005e7606d7f0c6b88aed2ba9b81ba0098290 | |
parent | 0d00d7bde0de878dcd435101d3dc54b23ccdb362 (diff) |
let length(0.000) conform to what gnu bc does; from AIDA Shinra
-rw-r--r-- | usr.bin/dc/bcode.c | 4 |
1 files 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 <otto@drijf.net> @@ -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(); |