We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c50a626 commit 26277bbCopy full SHA for 26277bb
benchmark/src/calc.lisp
@@ -70,19 +70,6 @@
70
(incf i))
71
x))
72
73
-(defun median (data)
74
- (let* ((n (length data))
75
- (n/2 (truncate (/ n 2))))
76
- (if (oddp n)
77
- (elt data n/2)
78
- (/ (+ (elt data n/2)
79
- (elt data (1- n/2)))
80
- 2))))
81
-
82
-(defun mean (data)
83
- (/ (reduce #'+ data)
84
- (length data)))
85
86
(defun nine-frac (n)
87
(loop
88
for i from 1 upto n
@@ -103,8 +90,8 @@
103
90
(n (length data)))
104
91
(let ((min (aref data 0))
105
92
(max (aref data (1- n)))
106
- (median (median data))
107
- (mean (mean data))
93
+ (median (alexandria:median data))
94
+ (mean (alexandria:mean data))
108
95
(nine-2 (nines-value 2 data))
109
96
(nine-3 (nines-value 3 data))
110
97
(nine-4 (nines-value 4 data))
0 commit comments