-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add manual pages #186
Open
Artoria2e5
wants to merge
1
commit into
ulfjack:master
Choose a base branch
from
Artoria2e5:man
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add manual pages #186
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
.\" Please update the date every time you change the doc! | ||
.Dd October 15, 2020 | ||
.Dt ryu 3 | ||
.Os | ||
.Sh NAME | ||
.Nm ryu , | ||
.Nm d2s , | ||
.Nm d2s_buffered , | ||
.Nm d2s_buffered_n , | ||
.Nm f2s , | ||
.Nm f2s_buffered , | ||
.Nm f2s_buffered_n , | ||
.Nm d2fixed , | ||
.Nm d2fixed_buffered , | ||
.Nm d2fixed_buffered_n , | ||
.Nm d2exp , | ||
.Nm d2exp_buffered , | ||
.Nm d2exp_buffered_n | ||
.Nd convert floats to decimal strings | ||
.Sh LIBRARY | ||
.Lb libryu | ||
.Sh SYNOPSIS | ||
.In ryu.h | ||
.Ft "char *" | ||
.Fn d2s "double f" | ||
.Ft "void" | ||
.Fn d2s_buffered "double f, char* result" | ||
.Ft "int" | ||
.Fn d2s_buffered_n "double f, char* result" | ||
.Ft "char *" | ||
.Fn f2s "float f" | ||
.Ft "void" | ||
.Fn f2s_buffered "float f, char* result" | ||
.Ft "int" | ||
.Fn f2s_buffered_n "float f, char* result" | ||
.Ft "char *" | ||
.Fn d2fixed "double f" | ||
.Ft "void" | ||
.Fn d2fixed_buffered "double f, char* result" | ||
.Ft "int" | ||
.Fn d2fixed_buffered_n "double f, char* result" | ||
.Ft "char *" | ||
.Fn d2exp "double f" | ||
.Ft "void" | ||
.Fn d2exp_buffered "double f, char* result" | ||
.Ft "int" | ||
.Fn d2exp_buffered_n "double f, char* result" | ||
.Sh DESCRIPTION | ||
The functions convert IEEE-754 floating-point numbers to decimal strings using | ||
shortest, fixed, or scientific formatting. | ||
.Ss BEHAVIOR AND RETURN VALUE | ||
.Bl -bullet | ||
.It | ||
The functions returning | ||
.Ft "char *" | ||
simply provide a pointer to a null-terminated string in a buffer created by | ||
.Xr malloc 3 . | ||
.It | ||
The functions returning | ||
.Ft "void" | ||
fills the given buffer with a null-terminated string. | ||
.It | ||
The functions returning | ||
.Ft "int" | ||
fills the given buffer with a non-terminated string, returning the number of | ||
characters written. | ||
.El | ||
.Ss OUTPUT FORMATS | ||
.Bl -tag | ||
.It Shortest | ||
Used by | ||
.Fn d2s | ||
and | ||
.Fn f2s . | ||
The shortest representation that can be parsed into the same number of the same | ||
precision. | ||
.It Fixed | ||
Used by | ||
.Fn d2fixed . | ||
Fixed-point notation, as in | ||
.Ql %f . | ||
.It Scientific | ||
Used by | ||
.Fn d2exp . | ||
Scientific notation, as in | ||
.Ql %e . | ||
.El | ||
.Sh SEE ALSO | ||
.Xr printf 3 | ||
.Xr ryu_generic_128 3 | ||
.Xr ryu_parse 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.\" Please update the date every time you change the doc! | ||
.Dd October 15, 2020 | ||
.Dt ryu_generic_128 3 | ||
.Os | ||
.Sh NAME | ||
.Nm ryu_generic_128 , | ||
.Nm s2d , | ||
.Nm s2d_n , | ||
.Nm s2f , | ||
.Nd convert arbitrary-sized floats to decimal | ||
.Sh LIBRARY | ||
.Lb libryu | ||
.Sh SYNOPSIS | ||
.In ryu_generic_128.h | ||
.Vt struct floating_decimal_128 | ||
{ | ||
.D1 Fa "__uint128_t mantissa" ; | ||
.D1 Fa "int32_t exponent" ; | ||
.D1 Fa "bool sign" ; | ||
}; | ||
|
||
.\" TODO | ||
.Sh DESCRIPTION | ||
.Nm | ||
extends | ||
.Xr ryu 3 | ||
to handle much larger floating-point sizes. It is accordingly slower. | ||
.Sh SEE ALSO | ||
.Xr printf 3 | ||
.Xr ryu 3 | ||
.Xr ryu_parse 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.\" Please update the date every time you change the doc! | ||
.Dd October 15, 2020 | ||
.Dt ryu_parse 3 | ||
.Os | ||
.Sh NAME | ||
.Nm ryu_parse , | ||
.Nm s2d , | ||
.Nm s2d_n , | ||
.Nm s2f , | ||
.Nd convert decimal strings to floats | ||
.Sh LIBRARY | ||
.Lb libryu | ||
.Sh SYNOPSIS | ||
.In ryu_parse.h | ||
.Vt enum Status | ||
{ | ||
.D1 Dv SUCCESS , | ||
.D1 Dv INPUT_TOO_SHORT , | ||
.D1 Dv INPUT_TOO_LONG , | ||
.D1 Dv MALFORMED_INPUT | ||
}; | ||
|
||
.\" TODO | ||
.Sh DESCRIPTION | ||
.Nm | ||
parses a decimal string of limited length (17) to a floating-point value, | ||
using an algorithm based on | ||
.Xr ryu 3 . | ||
It is not yet able to handle all formats. | ||
.Sh SEE ALSO | ||
.Xr printf 3 | ||
.Xr ryu_generic_128 3 | ||
.Xr ryu 3 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you write these by hand or is there a way to auto-generate them from the header files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrote it by hand, but the prototypes are definitely being auto-generated somewhere in the world...