[libc][NFC] Add supporting class for atof implementation
authorMichael Jones <michaelrj@google.com>
Fri, 24 Sep 2021 23:11:11 +0000 (23:11 +0000)
committerMichael Jones <michaelrj@google.com>
Mon, 4 Oct 2021 21:08:02 +0000 (21:08 +0000)
commit6f80339b18da61be986e75b4824ff5b308412ead
tree3c4c32518b6fec130794873f0f85a04abe468653
parentbb69f1dcf900f694dd5cf4af4b7212109dc26c6a
[libc][NFC] Add supporting class for atof implementation

This change adds the High Precision Decimal described here:
https://nigeltao.github.io/blog/2020/parse-number-f64-simple.html
It will be used for the atof implementation later, but is complete and
tested now.

The code is inspired by the golang implmentation of the HPD class, which
can be found here: https://github.com/golang/go/blob/release-branch.go1.16/src/strconv/decimal.go

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D110454
libc/src/__support/CMakeLists.txt
libc/src/__support/high_precision_decimal.h [new file with mode: 0644]
libc/test/src/__support/CMakeLists.txt
libc/test/src/__support/high_precision_decimal_test.cpp [new file with mode: 0644]
libc/utils/mathtools/GenerateHPDConstants.py [new file with mode: 0644]