Skip to content

Commit

Permalink
Add a caveat wrt use of non-decimal fractional notation; from kshe; o…
Browse files Browse the repository at this point in the history
…k jmc@
  • Loading branch information
omoerbeek committed Dec 2, 2017
1 parent eea170b commit 07a84ed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions usr.bin/dc/dc.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $OpenBSD: dc.1,v 1.31 2017/11/28 06:51:19 otto Exp $
.\" $OpenBSD: dc.1,v 1.32 2017/12/02 07:35:46 otto Exp $
.\"
.\" Copyright (C) Caldera International Inc. 2001-2002.
.\" All rights reserved.
Expand Down Expand Up @@ -34,7 +34,7 @@
.\"
.\" @(#)dc.1 8.1 (Berkeley) 6/6/93
.\"
.Dd $Mdocdate: November 28 2017 $
.Dd $Mdocdate: December 2 2017 $
.Dt DC 1
.Os
.Sh NAME
Expand Down Expand Up @@ -245,7 +245,7 @@ Mark used by the
operator.
The
.Ic M
operator is a non-portable extensions, used by the
operator is a non-portable extension, used by the
.Xr bc 1
command.
.It Ic N
Expand Down Expand Up @@ -536,3 +536,8 @@ The current version of the
.Nm
utility was written by
.An Otto Moerbeek .
.Sh CAVEATS
While fractional input in base 10 is always exact,
other bases may suffer from unintuitive rounding.
To avoid surprising results, plain integer division can be used
instead of the corresponding floating point notation.

2 comments on commit 07a84ed

@asomers
Copy link

@asomers asomers commented on 07a84ed Dec 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I've written an actual fix for the bug that you just documented. It's under review here:
https://reviews.freebsd.org/D13336

@omoerbeek
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO you should be very careful when deviating from what gnu dc is doing.

Please sign in to comment.