1 | [[tags: egg]] |
---|

2 | |
---|

3 | == Introduction |
---|

4 | |
---|

5 | A logarithmic number system (LNS) is an arithmetic system for |
---|

6 | representing real numbers. In LNS, a number X, is represented by the |
---|

7 | logarithm L of its absolute value: |
---|

8 | |
---|

9 | X -> { s, L = \log_b(|X|) } |
---|

10 | |
---|

11 | where {{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 | |
---|

41 | Ivan Raikov |
---|

42 | |
---|

43 | == Version |
---|

44 | |
---|

45 | ; 1.0 : Initial version |
---|

46 | |
---|

47 | == License |
---|

48 | |
---|

49 | Copyright 2009 Ivan Raikov and the Okinawa Institute of Science and |
---|

50 | Technology. |
---|

51 | |
---|

52 | This program is free software: you can redistribute it and/or modify |
---|

53 | it under the terms of the GNU General Public License as published by |
---|

54 | the Free Software Foundation, either version 3 of the License, or (at |
---|

55 | your option) any later version. |
---|

56 | |
---|

57 | This program is distributed in the hope that it will be useful, but |
---|

58 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|

59 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|

60 | General Public License for more details. |
---|

61 | |
---|

62 | A full copy of the GPL license can be found at |
---|

63 | <http://www.gnu.org/licenses/>. |
---|