aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/strap/FPS-.lsp
blob: 744e62bf2e4f2cea3403814f5fd1c74607137a1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
(/VERSIONCHECK 2) 

(DECLAIM (FTYPE (FUNCTION (|%Integer| |%Integer| |%Shell|) |%Thing|)
                |FPS-;float;2IS;1|)) 

(DECLAIM (FTYPE (FUNCTION (|%Shell|) (|%IntegerSection| 1))
                |FPS-;digits;Pi;2|)) 

(DEFUN |FPS-;float;2IS;1| (|ma| |ex| $)
  (SPADCALL |ma| |ex| (SPADCALL (|getShellEntry| $ 8))
      (|getShellEntry| $ 10))) 

(DEFUN |FPS-;digits;Pi;2| ($)
  (LET ((#0=#:G1402
            (MAX 1
                 (TRUNCATE
                     (SPADCALL 4004
                         (- (SPADCALL (|getShellEntry| $ 14)) 1)
                         (|getShellEntry| $ 16))
                     13301))))
    (|check-subtype| (AND (NOT (MINUSP #0#)) (PLUSP #0#))
        '(|PositiveInteger|) #0#))) 

(DEFUN |FloatingPointSystem&| (|#1|)
  (LET* ((|dv$1| (|devaluate| |#1|))
         (|dv$| (LIST '|FloatingPointSystem&| |dv$1|))
         ($ (|newShell| 20))
         (|pv$| (|buildPredVector| 0 0
                    (LIST (|HasAttribute| |#1| '|arbitraryExponent|)
                          (|HasAttribute| |#1| '|arbitraryPrecision|)))))
    (|setShellEntry| $ 0 |dv$|)
    (|setShellEntry| $ 3 |pv$|)
    (|stuffDomainSlots| $)
    (|setShellEntry| $ 6 |#1|)
    $)) 

(MAKEPROP '|FloatingPointSystem&| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|PositiveInteger|)
             (0 . |base|) (|Integer|) (4 . |float|) |FPS-;float;2IS;1|
             (11 . |One|) (15 . |One|) (19 . |bits|) (23 . -) (29 . *)
             (35 . |quo|) (41 . |max|) |FPS-;digits;Pi;2|)
          '#(|float| 47 |digits| 53) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 19
                                '(0 6 7 8 3 6 0 9 9 7 10 0 6 0 12 0 7 0
                                  13 0 6 7 14 2 9 0 0 0 15 2 9 0 7 0 16
                                  2 9 0 0 0 17 2 9 0 0 0 18 2 0 0 9 9
                                  11 0 0 7 19)))))
          '|lookupComplete|))