Printing floating-point numbers quickly and accurately with integers

@inproceedings{Loitsch2010PrintingFN,
  title={Printing floating-point numbers quickly and accurately with integers},
  author={Florian Loitsch},
  booktitle={PLDI '10},
  year={2010}
}
We present algorithms for accurately converting floating-point numbers to decimal representation. [] Key Method Our second algorithm improves on the first one by using the additional bits to produce a shorter (often the shortest) result. Finally we propose a third version that can be used when the shortest output is a requirement. The last algorithm either produces optimal decimal representations (with respect to shortness and rounding) or rejects its input. For IEEE 754 double-precision numbers and 64-bit…

Figures from this paper

Printing floating-point numbers: a faster, always correct method
TLDR
Errol is presented, a new complete algorithm that is guaranteed to produce correct and optimal results for all inputs while simultaneously being 2x faster than the incomplete Grisu3 and 4X faster than previous complete methods.
Printing Floating-Point Numbers An Always Correct Method
TLDR
Errol is presented, a new complete algorithm that is guaranteed to produce correct and optimal results for all inputs by sacrificing a speed penalty to the incomplete Grisu3 but 5.2× faster than previous complete methods.
Ryū revisited: printf floating point conversion
  • Ulf Adams
  • Computer Science
    Proc. ACM Program. Lang.
  • 2019
TLDR
It is shown that both Ryū and Ryū Printf generalize to arbitrary number bases, which implies the existence of a fast algorithm to convert from base-10 to base-2, as long as the maximum precision of the input is known a priori.
Number parsing at a gigabyte per second
  • D. Lemire
  • Computer Science
    Softw. Pract. Exp.
  • 2021
TLDR
By combining the significand and precomputed tables, the solution to the problem of parsing decimal numbers to the nearest binary floating‐point value can be several times faster than conventional functions present in standard C libraries on modern 64‐bit systems.
Basic Properties and Algorithms
In this chapter, we present some short yet useful algorithms and some basic properties that can be derived from specifications of floating-point arithmetic systems, such as the ones given in the
Ryū: fast float-to-string conversion
TLDR
Ryū, a new routine to convert binary floating point numbers to their decimal representations using only fixed-size integer operations, is presented and its correctness is proved.
Infra: structure all the way down: structured data as a visual programming language
TLDR
It is argued that Infra can be used to improve existing software projects and that bringing direct authoring and human readability to a binary data paradigm could have rippling ramifications on the computing landscape.
Abstraction in technical computing
TLDR
Aion in Technical Computing by Jeffrey Werner Bezanson A.B., Harvard University (2004) S.M., Massachusetts Institute of Technology (2012) andsubmitted to the Department of Electrical Engineering and Computer Science in partial fulfillment of the requirements for the degree of Doctor of Philosophy.
Rethinking the human-readability infrastructure
TLDR
This work outlines an alternative human-readability infrastructure that is simultaneously appropriate for textual formats and binary runtime data structures, and consists of a binary metaformat and corresponding language-independent structure editor.
An Always Correct Method
  • 2016
...
...

References

SHOWING 1-10 OF 11 REFERENCES
How to print floating-point numbers accurately
TLDR
Algorithm for accurately converting floating-point numbers to decimal representation to carry along with the computation an explicit representation of the required rounding accuracy and modify the free-format conversion algorithm for use in fixed-format applications.
How to print floating-point numbers accurately
TLDR
Algorithms for accurately converting floating-point numbers to decimal representation and modification of the well-known algorithm for radix-conversion of fixed-point fractions by multiplication for use in fixed-format applications.
Printing floating-point numbers quickly and accurately
TLDR
This paper presents a fast and accurate algorithm for printing floating-point numbers in both free- and fixed-format modes, and employs a fast estimator to scale floating- point numbers efficiently.
Contributions to a proposed standard for binary floating-point arithmetic (computer arithmetic)
TLDR
This thesis consists of a set of "footnotes" to the proposed standard for binary floating-point arithmetic, which include an analysis of gradual underflow, the most controversial feature of the standard.
Correctly Rounded Binary-Decimal and Decimal-Binary Conversions
TLDR
This note discusses the main issues in performing correctly rounded decimal-to-binary and binary- to-decimal conversions and describes some efficiency enhancements.
An implementation guide to a proposed standard for floating-point arithmetic
This standard is a product of the Floating-Point Working Group of the Microprocessor Standards Subcommittee of the Standards Committee of the IEEE Computer Society. This work was sponsored by the
Special Feature an Implementation Guide to a Proposed Standard for Floating-Point Arithmetic
This guide to an IEEE draft standard provides practical algorithms for floating-point arithmetic operations and suggests the hardware/software mix for handling exceptions.
What Every Computer Scientist Should Know About Floating-Point Arithmetic
TLDR
The OPEN LOOKand Sun™ Graphical User Interfaces were developed by Sun Microsystems, Inc. for its users and licensees and Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry.
The Art of Computer Programming, Volume II: Seminumerical Algorithms
Standard for Binary Floating-Point Arithmetic
  • Standard for Binary Floating-Point Arithmetic
  • 1985
...
...