boostorg / boostorg/json

How to get the literal value of a number?

Open
#1,074 18 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
479
Forks
110
Avg merge
10d 3h
Merged PRs (30d)
5

Description

For instance, for json content

```json
{"value": 1.23456789234567892345678923456789234567892345678923456789}
```

I'd like to get a string-like `1.23456789234567892345678923456789234567892345678923456789` from parsed `value`.

This is useful not even for arbitrary precision floats, but for decimal floats. Number `0.1` has no accurate representation with IEEE754 binary float. Some users may want to pass this value as-is to their decimal float library, so they need the literal value.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.