-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathryu-docs.factor
24 lines (20 loc) · 975 Bytes
/
ryu-docs.factor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
! Copyright (C) 2018 Alexander Ilin.
! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax kernel math strings ;
IN: ryu
ABOUT: "ryu"
ARTICLE: "ryu" "Ryū Float to String Conversion"
{ "The " { $vocab-link "ryu" } " vocab contains a Factor implementation of the Ryū algorithm to quickly convert floating point numbers to decimal strings. Only the double-precision floats (64-bit) are supported. Original author's reference implementation (C and Java) and additional information can be found here: " { $url "https://github.com/ulfjack/ryu" } "."
{ $subsections print-float d2s } } ;
HELP: print-float
{ $values
{ "value" number }
{ "string" string }
}
{ $description "Convert the " { $snippet "number" } " into its shortest stable floating-point representation string using the Ryū algorithm." } ;
HELP: d2s
{ $values
{ "value" number }
{ "string" string }
}
{ $description "An alias for " { $link print-float } "." } ;