mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Release calc version 2.12.0.3
This commit is contained in:
28
help/digit
28
help/digit
@@ -28,11 +28,11 @@ DESCRIPTION
|
||||
left of the "decimal" point; the digit d_n at position n contributes
|
||||
additively d_n * b^n to the value of x. For example,
|
||||
|
||||
d_2 d_1 d_0 . d_-1 d_-2
|
||||
; d_2 d_1 d_0 . d_-1 d_-2
|
||||
|
||||
represents the number
|
||||
|
||||
d_2 * b^2 + d_1 * b + d0 + d_-1 * b^-1 + d_-2 * b^-2
|
||||
; d_2 * b^2 + d_1 * b + d0 + d_-1 * b^-1 + d_-2 * b^-2
|
||||
|
||||
The sequence of digits has to be infinite if den(x) has a prime factor
|
||||
which is not a factor of the base b. In cases where the representation
|
||||
@@ -53,30 +53,30 @@ DESCRIPTION
|
||||
With base-b digits for x as explained above, the integer whose base-b
|
||||
representation is
|
||||
|
||||
b_n+k-1 b_n_k-2 ... b_n,
|
||||
; b_n+k-1 b_n_k-2 ... b_n,
|
||||
|
||||
i.e. the k digits with last digit b_n, is given by
|
||||
|
||||
digit(b^-r * x, q, b^k)
|
||||
; digit(b^-r * x, q, b^k)
|
||||
|
||||
if r and q satisfy n = q * b + r.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
> a = 123456.789
|
||||
> for (n = 6; n >= -6; n++) print digit(a, n),; print
|
||||
; a = 123456.789
|
||||
; for (n = 6; n >= -6; n++) print digit(a, n),; print
|
||||
0 1 2 3 4 5 6 7 8 9 0 0 0
|
||||
|
||||
> for (n = 6; n >= -6; n--) print digit(a, n, 100),; print
|
||||
; for (n = 6; n >= -6; n--) print digit(a, n, 100),; print
|
||||
0 0 0 0 12 34 56 78 90 0 0 0 0
|
||||
|
||||
> for (n = 6; n >= -6; n--) print digit(a, n, 256),; print
|
||||
; for (n = 6; n >= -6; n--) print digit(a, n, 256),; print
|
||||
0 0 0 0 1 226 64 201 251 231 108 139 67
|
||||
|
||||
> for (n = 1; n >= -12; n++) print digit(10/7, n),; print
|
||||
> 0 1 4 2 8 5 7 1 4 2 8 5 7 1
|
||||
; for (n = 1; n >= -12; n++) print digit(10/7, n),; print
|
||||
; 0 1 4 2 8 5 7 1 4 2 8 5 7 1
|
||||
|
||||
> print digit(10/7, -7e1000, 1e6)
|
||||
; print digit(10/7, -7e1000, 1e6)
|
||||
428571
|
||||
|
||||
LIMITS
|
||||
@@ -92,7 +92,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
bit
|
||||
|
||||
## Copyright (C) 1999 Landon Curt Noll
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
##
|
||||
## Calc is open software; you can redistribute it and/or modify it under
|
||||
## the terms of the version 2.1 of the GNU Lesser General Public License
|
||||
@@ -108,8 +108,8 @@ SEE ALSO
|
||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.4 $
|
||||
## @(#) $Id: digit,v 29.4 2000/12/17 12:27:58 chongo Exp $
|
||||
## @(#) $Revision: 29.5 $
|
||||
## @(#) $Id: digit,v 29.5 2006/06/10 12:28:10 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/digit,v $
|
||||
##
|
||||
## Under source code control: 1995/10/03 10:40:01
|
||||
|
Reference in New Issue
Block a user