source: project/wiki/lognum @ 12979

Last change on this file since 12979 was 12979, checked in by Ivan Raikov, 11 years ago

Added lognum-sign and lognum-value.

File size: 1.7 KB
Line 
1[[tags: egg]]
2
3== Introduction
4
5A logarithmic number system (LNS) is an arithmetic system for
6representing real numbers. In LNS, a number X, is represented by the
7logarithm L of its absolute value:
8
9    X -> { s, L = \log_b(|X|) }
10
11where {{s}} denotes the sign of {{X}}
12({{s = 1}} if {{X > 0}} and {{s = -1}} if {{X < 0}}).
13
14
15== Requires
16
17; [[syntax-case]]
18; [[matchable]]
19; [[datatype]]
20
21
22== Library procedures
23
24<procedure>{{lognum?:: X -> BOOL}}</procedure>
25<procedure>{{lognum-sign:: X -> INTEGER}}</procedure>
26<procedure>{{lognum-value:: X -> NUMBER}}</procedure>
27<procedure>{{number->lognum:: NUMBER -> LOGNUM}}</procedure>
28<procedure>{{lognum->number:: LOGNUM -> NUMBER}}</procedure>
29<procedure>{{lognum+:: A * B -> X}}</procedure>
30<procedure>{{lognum-:: A * B -> X}}</procedure>
31<procedure>{{lognum*:: A * B -> X}}</procedure>
32<procedure>{{lognum/:: A * B -> X}}</procedure>
33<procedure>{{lognum-neg:: A -> B}}</procedure>
34<procedure>{{lognum-abs:: A -> B}}</procedure>
35<procedure>{{lognum-signum:: A -> B}}</procedure>
36<procedure>{{lognum-recip:: A -> B}}</procedure>
37
38
39== Authors
40
41Ivan Raikov
42
43== Version
44
45; 1.0 : Initial version
46
47== License
48
49Copyright 2009 Ivan Raikov and the Okinawa Institute of Science and
50Technology.
51
52This program is free software: you can redistribute it and/or modify
53it under the terms of the GNU General Public License as published by
54the Free Software Foundation, either version 3 of the License, or (at
55your option) any later version.
56
57This program is distributed in the hope that it will be useful, but
58WITHOUT ANY WARRANTY; without even the implied warranty of
59MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
60General Public License for more details.
61
62A full copy of the GPL license can be found at
63<http://www.gnu.org/licenses/>.
Note: See TracBrowser for help on using the repository browser.