Documentation
¶
Overview ¶
Package fpfmt implements floating point formatting algorithm and benchmarks to compare with other algorithms.
Example (Div) ¶
Output: ⟨2.5+⟩ 3
Example (Nudge) ¶
Output: x nudge(-1).floor floor ceil nudge(+1).ceil ⟨15.0⟩ 14 15 15 16 ⟨15.0+⟩ 15 15 16 16 ⟨15.5+⟩ 15 15 16 16 ⟨16.0⟩ 15 16 16 17
Example (Unround) ¶
Output: x raw str 6 24 ⟨6.0⟩ 6.001 25 ⟨6.0+⟩ 6.499 25 ⟨6.0+⟩ 6.5 26 ⟨6.5⟩ 6.501 27 ⟨6.5+⟩ 6.999 27 ⟨6.5+⟩ 7 28 ⟨7.0⟩
Example (Unround_floor) ¶
Output: x floor round½↓ round round½↑ ceil ⟨6.0⟩ 6 6 6 6 6 ⟨6.0+⟩ 6 6 6 6 7 ⟨6.0+⟩ 6 6 6 6 7 ⟨6.5⟩ 6 6 6 7 7 ⟨6.5+⟩ 6 7 7 7 7 ⟨6.5+⟩ 6 7 7 7 7 ⟨7.0⟩ 7 7 7 7 7 ⟨7.5⟩ 7 7 8 8 8 ⟨8.5⟩ 8 8 8 9 9
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixedWidth ¶
FixedWidth returns the n-digit decimal form of f as d * 10**p. n can be at most 18.
func Fmt ¶
Fmt formats d, p into s in exponential notation. The caller must pass nd set to the number of digits in d. It returns the number of bytes written to s.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bench exists to provide a C library.
|
Package bench exists to provide a C library. |
|
Package fpfmt implements floating point formatting algorithm and benchmarks to compare with other algorithms.
|
Package fpfmt implements floating point formatting algorithm and benchmarks to compare with other algorithms. |
Click to show internal directories.
Click to hide internal directories.