The wu-decimal Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The wu-decimal Reference Manual

This is the wu-decimal Reference Manual, version 2.0.0, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:31:25 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

1.1 wu-decimal

Author

Wukix Inc <engineering@wukix.com>

License

FreeBSD

Description

Arbitrary-precision decimal arithmetic

Long Description

Wu-Decimal enables convenient, arbitrary-precision decimal arithmetic through a reader macro, #$, and an update to the pprint dispatch table. Wu-Decimal uses the CL ratio type to store decimals, which enables numeric functions such as +, -, etc. to operate on decimal numbers in a natural way.

Version

2.0.0

Source

wu-decimal.asd (file)

Component

wu-decimal.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

2 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

2.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

2.1.1 wu-decimal.asd

Location

wu-decimal.asd

Systems

wu-decimal (system)

Packages

wu-decimal-asd


Previous: , Up: Lisp files   [Contents][Index]

2.1.2 wu-decimal/wu-decimal.lisp

Parent

wu-decimal (system)

Location

wu-decimal.lisp

Packages

wu-decimal

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

3 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

3.1 wu-decimal-asd

Source

wu-decimal.asd

Use List

Previous: , Up: Packages   [Contents][Index]

3.2 wu-decimal

Source

wu-decimal.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

4.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.1 Special variables

Special Variable: *print-decimal-mark*
Package

wu-decimal

Source

wu-decimal.lisp (file)

Special Variable: *print-precision-loss*

Precision loss mode. Must be :error, :round, or :truncate

Package

wu-decimal

Source

wu-decimal.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.2 Functions

Function: $ STREAM DECIMAL COLON ATSIGN &optional D N W PAD

e.g. (format t "~/wu-decimal:$/" #$3.14)

Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: disable-decimal-printing-for-ratios ()
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: enable-decimal-printing-for-ratios ()
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: enable-reader-macro &key EXPONENT-ALLOWED
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: f STREAM NUMBER COLON ATSIGN &optional W D K OVF PAD

e.g. (format t "~/wu-decimal:F/" #$3.14)

Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: parse-decimal STRING &key START END SIGN-ALLOWED DECIMAL-MARK GROUP-SEPARATOR EXPONENT-ALLOWED JUNK-ALLOWED

PARSE-DECIMAL parses a decimal number from the substring of STRING delimited by START and END. Optional leading and trailing whitespace[1] is ignored. The character parameters DECIMAL-MARK and GROUP-SEPARATOR provide support for different (typically cultural) numerical conventions. For convenience, a GROUP-SEPARATOR of T will be treated as the comma character. The boolean SIGN-ALLOWED controls signage. EXPONENT-ALLOWED is a boolean or a sequence controlling exponent notation. Exponent notation follows the syntax for CL floats, with exception that the exponent marker must be ’e’ or ’E’ when EXPONENT-ALLOWED is T, or the exponent marker must be CHAR= to some element of EXPONENT-ALLOWED when EXPONENT-ALLOWED is a
sequence. JUNK-ALLOWED behaves as it does in PARSE-INTEGER. PARSE-DECIMAL returns two values: the parsed number of type DECIMAL, followed by the index of STRING where the parse terminated.
Example: (parse-decimal "1,205.42" :group-separator #\,) => 60271/50, 8

Package

wu-decimal

Source

wu-decimal.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

4.1.3 Types

Type: decimal ()
Package

wu-decimal

Source

wu-decimal.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

4.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

4.2.1 Functions

Function: count-digits INTEGER
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: decimal-reader STREAM SUBCHAR ARG
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: decimal-reader-exponent-allowed STREAM SUBCHAR ARG
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: decimal-to-digits NUMBER &optional POSITION RELATIVEP
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: decimal-to-string X &optional WIDTH FDIGITS SCALE FMIN
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: factor-out-powers-of-5 NUMBR
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: find-multiplier D

Given an integer, d, of the form 2^m*5^n, compute c such that c*d = c*(2^m*5^n) = 10^max(m,n). Returns c and max(m,n). See http://wukix.com/lisp-decimals#theory for background.

Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: format-fixed-aux STREAM NUMBER W D K OVF PAD ATSIGN
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: has-finite-decimal-digits NUMBER
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: integer-to-digit-string INTEGER

Converts an integer into a base 10 string. The sign is ignored.

Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: is-power-of-2 NUMBER
Package

wu-decimal

Source

wu-decimal.lisp (file)

Function: whitespace-1-p A-CHAR
Package

wu-decimal

Source

wu-decimal.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

4.2.2 Conditions

Condition: disallowed-loss-of-precision ()
Package

wu-decimal

Source

wu-decimal.lisp (file)

Direct superclasses

condition (condition)

Condition: incompatible-exponent-allowed-error ()
Package

wu-decimal

Source

wu-decimal.lisp (file)

Direct superclasses

condition (condition)

Condition: incompatible-mark-and-separator-error ()
Package

wu-decimal

Source

wu-decimal.lisp (file)

Direct superclasses

condition (condition)

Condition: out-of-bounds-error ()
Package

wu-decimal

Source

wu-decimal.lisp (file)

Direct superclasses

condition (condition)


Previous: , Up: Internal definitions   [Contents][Index]

4.2.3 Types

Type: decimal-for-pprint ()
Package

wu-decimal

Source

wu-decimal.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   W  
Index Entry  Section

F
File, Lisp, wu-decimal.asd: The wu-decimal<dot>asd file
File, Lisp, wu-decimal/wu-decimal.lisp: The wu-decimal/wu-decimal<dot>lisp file

L
Lisp File, wu-decimal.asd: The wu-decimal<dot>asd file
Lisp File, wu-decimal/wu-decimal.lisp: The wu-decimal/wu-decimal<dot>lisp file

W
wu-decimal.asd: The wu-decimal<dot>asd file
wu-decimal/wu-decimal.lisp: The wu-decimal/wu-decimal<dot>lisp file

Jump to:   F   L   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   $  
C   D   E   F   H   I   P   W  
Index Entry  Section

$
$: Exported functions

C
count-digits: Internal functions

D
decimal-reader: Internal functions
decimal-reader-exponent-allowed: Internal functions
decimal-to-digits: Internal functions
decimal-to-string: Internal functions
disable-decimal-printing-for-ratios: Exported functions

E
enable-decimal-printing-for-ratios: Exported functions
enable-reader-macro: Exported functions

F
f: Exported functions
factor-out-powers-of-5: Internal functions
find-multiplier: Internal functions
format-fixed-aux: Internal functions
Function, $: Exported functions
Function, count-digits: Internal functions
Function, decimal-reader: Internal functions
Function, decimal-reader-exponent-allowed: Internal functions
Function, decimal-to-digits: Internal functions
Function, decimal-to-string: Internal functions
Function, disable-decimal-printing-for-ratios: Exported functions
Function, enable-decimal-printing-for-ratios: Exported functions
Function, enable-reader-macro: Exported functions
Function, f: Exported functions
Function, factor-out-powers-of-5: Internal functions
Function, find-multiplier: Internal functions
Function, format-fixed-aux: Internal functions
Function, has-finite-decimal-digits: Internal functions
Function, integer-to-digit-string: Internal functions
Function, is-power-of-2: Internal functions
Function, parse-decimal: Exported functions
Function, whitespace-1-p: Internal functions

H
has-finite-decimal-digits: Internal functions

I
integer-to-digit-string: Internal functions
is-power-of-2: Internal functions

P
parse-decimal: Exported functions

W
whitespace-1-p: Internal functions

Jump to:   $  
C   D   E   F   H   I   P   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*print-decimal-mark*: Exported special variables
*print-precision-loss*: Exported special variables

S
Special Variable, *print-decimal-mark*: Exported special variables
Special Variable, *print-precision-loss*: Exported special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   D   I   O   P   S   T   W  
Index Entry  Section

C
Condition, disallowed-loss-of-precision: Internal conditions
Condition, incompatible-exponent-allowed-error: Internal conditions
Condition, incompatible-mark-and-separator-error: Internal conditions
Condition, out-of-bounds-error: Internal conditions

D
decimal: Exported types
decimal-for-pprint: Internal types
disallowed-loss-of-precision: Internal conditions

I
incompatible-exponent-allowed-error: Internal conditions
incompatible-mark-and-separator-error: Internal conditions

O
out-of-bounds-error: Internal conditions

P
Package, wu-decimal: The wu-decimal package
Package, wu-decimal-asd: The wu-decimal-asd package

S
System, wu-decimal: The wu-decimal system

T
Type, decimal: Exported types
Type, decimal-for-pprint: Internal types

W
wu-decimal: The wu-decimal system
wu-decimal: The wu-decimal package
wu-decimal-asd: The wu-decimal-asd package

Jump to:   C   D   I   O   P   S   T   W