skip to main content
10.1145/3192366.3192369acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article
Open Access
Artifacts Evaluated & Functional

Ryū: fast float-to-string conversion

Published:11 June 2018Publication History

ABSTRACT

We present Ryū, a new routine to convert binary floating point numbers to their decimal representations using only fixed-size integer operations, and prove its correctness. Ryū is simpler and approximately three times faster than the previously fastest implementation.

Skip Supplemental Material Section

Supplemental Material

p270-adams.webm

webm

93.8 MB

References

  1. Ulf Adams. 2018. ulfjack/ryu. (Feb. 2018). https://github.com/ulfjack/ryuGoogle ScholarGoogle Scholar
  2. Marc Andrysco, Ranjit Jhala, and Sorin Lerner. 2016. Printing Floating-point Numbers: A Faster, Always Correct Method. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '16). ACM, New York, NY, USA, 555- 567. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Robert G. Burger and R. Kent Dybvig. 1996. Printing Floating-point Numbers Quickly and Accurately. In Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation (PLDI '96). ACM, New York, NY, USA, 108s116. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Jerome Toby Coonen. 1980. An Implementation Guide to a Proposed Standard for Floating Point Arithmetic. Computer 13, 1 (Jan. 1980), 68s79. See errata in [5]. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Jerome Toby Coonen. 1981. Errata: An Implementation Guide to a Proposed Standard for Floating Point Arithmetic. Computer 14, 3 (March 1981), 62. See also [4]. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Florian Loitsch et al. 2017. google/double-conversion. (September 2017). https://github.com/google/double-conversion_commit_fe9b384793c4e79bd32133dc9053f27b75a5eeae.Google ScholarGoogle Scholar
  7. David M. Gay. 1990. Correctly Rounded Binary-Decimal and Decimal-Binary Conversions. Technical Report. AT&T Bell Laboratories. Numerical Analysis Manuscript 90-10.Google ScholarGoogle Scholar
  8. Torbjörn Granlund and Peter L. Montgomery. 1994. Division by Invariant Integers Using Multiplication. In Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation (PLDI '94). ACM, New York, NY, USA, 61s72. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. IEEE Computer Society. Microprocessor Standards Committee and Institute of Electrical and Electronics Engineers and IEEE-SA Standards Board. 2008. 754-2008 - IEEE Standard for Floating-Point Arithmetic. Institute of Electrical and Electronics Engineers (IEEE), New York.Google ScholarGoogle Scholar
  10. Aubrey Jaffer. 2013. Easy Accurate Reading and Writing of Floating-Point Numbers. (October 2013). https://arxiv.org/abs/1310.8121v6 Updated January 2015.Google ScholarGoogle Scholar
  11. Donald Ervin Knuth. 1997. The Art of Computer Programming (3rd ed.). Vol. I: Fundamental Algorithms. Addison-Wesley, Boston, Massachusetts, United States, Chapter 1.2.1 Mathematical Induction, p. 13-17.Google ScholarGoogle Scholar
  12. Donald Ervin Knuth. 1997. The Art of Computer Programming (3rd ed.). Vol. II: Seminumerical Algorithms. Addison-Wesley, Boston, Massachusetts, United States, Chapter 4.4 Radix Conversion, p. 326.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Florian Loitsch. 2010. Printing Floating-Point Numbers Quickly and Accurately with Integers. In Proceedings of the ACM SIGPLAN 2010 Conference on Programming Language Design and Implementation, PLDI 2010. ACM, New York, NY, USA, 233-243. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Klaus Samelson and Friedrich L. Bauer. 1953. Optimale Rechengenauigkeit bei Rechenanlagen mit gleitendem Komma. Zeitschrift für angewandte Mathematik und Physik (ZAMP) 4, 4 (Jul 1953), 312-316.Google ScholarGoogle Scholar
  15. Guy L. Steele, Jr. and Jon L. White. 1990. How to Print Floating-point Numbers Accurately. In Proceedings of the ACM SIGPLAN 1990 Conference on Programming Language Design and Implementation (PLDI '90). ACM, New York, NY, USA, 112s126. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Donald Taranto. 1959. Binary Conversion, with Fixed Decimal Precision, of a Decimal Fraction. Commun. ACM 2, 7 (July 1959), p. 27. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Ryū: fast float-to-string conversion

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      PLDI 2018: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation
      June 2018
      825 pages
      ISBN:9781450356985
      DOI:10.1145/3192366

      Copyright © 2018 Owner/Author

      This work is licensed under a Creative Commons Attribution-ShareAlike International 4.0 License.

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 11 June 2018

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate406of2,067submissions,20%

      Upcoming Conference

      PLDI '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader