Skip to content

Commit

Permalink
Note Java's incompatibility with other specs
Browse files Browse the repository at this point in the history
As noted in #87, the Java implementation doesn't match existing and upcoming specs for floating point output that require the shortest output. The implementation here attempts to follow Double.toString, which requires at least two digits of output.
  • Loading branch information
ulfjack authored Jan 14, 2019
1 parent dfc3f9d commit dd47f04
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ The Java implementations are RyuFloat and RyuDouble under src/main/java/. The
C implementation is in the ryu/ directory. Both cover 32 and 64-bit floating
point numbers.

*Note*: The Java implementation attempts to follow the Java specification for
Double.toString [1], which requires outputting at least two digits. Other
specifications, such as for JavaScript, require the shortest output. We may
change the Java implementation in the future to support both.

There is an experimental C low-level API and 128-bit implementation in ryu/.
These are still subject to change.

Expand All @@ -29,6 +34,8 @@ Other implementations:
| Factor | Alexander Iljin | https://github.com/AlexIljin/ryu |
| Go | Caleb Spare | https://github.com/cespare/ryu |

[1] https://docs.oracle.com/javase/10/docs/api/java/lang/Double.html#toString(double)

## Building, Testing, Running

We use the Bazel build system (https://bazel.build). We recommend using the
Expand Down

0 comments on commit dd47f04

Please sign in to comment.