source: project/wiki/eggref/3/fpio @ 13621

Last change on this file since 13621 was 13621, checked in by sjamaan, 11 years ago

Move old chicken 3 eggs over to eggref/3

File size: 1.6 KB
Line 
1[[tags: egg]]
2
3== Introduction
4
5The {{fpio}} library contains a routines for converting floating-point
6numbers between IEEE binary representation and decimal string
7representation. It is based on the [[http://www.netlib.org/fp/|gdtoa]]
8library by David Gay.
9
10There are two routines included with the library, {{string->fp}} and
11{{fp->string}}.
12
13== Library procedures
14
15=== {{fp->string:: NUMBER [* NDIGITS] -> STRING}}
16
17Converts the given floating-point number to decimal string
18representation.  If optional argument {{NDIGITS}} is positive, the
19conversion is done to the specified number of decimal places. If
20{{NDIGITS}} is zero (the default) or negative, the conversion is done
21to the shortest decimal string that rounds to the given floating point
22value.
23
24=== {{string->fp:: STRING [* ROUNDING] -> NUMBER}}
25
26Converts the given decimal string number to binary IEEE floating point
27representation.  Optional argument {{ROUNDING}} is a symbol that can
28be one of:
29
30; {{toward-zero}} : indicates rounding-towards-zero mode (the default)
31; {{nearest}} : indicates rounding-towards-nearest mode
32; {{toward+Inf}} : indicates rounding-towards +Inf mode
33; {{toward-Inf}} : indicates rounding-towards -Inf mode
34
35
36== Authors
37
38Ivan Raikov
39
40== Version
41
42; 1.2 : Fixes to the file manifest
43; 1.0 : Initial version
44
45== License
46
47Copyright 2008 Ivan Raikov.
48
49Permission to use, copy, modify, and distribute this software and its
50documentation for any purpose and without fee is hereby granted,
51provided that the above copyright notice appear in all copies and that
52both that the copyright notice and this permission notice appear in
53supporting documentation.
54
Note: See TracBrowser for help on using the repository browser.