Commit a392ade
authored
Fix bug in quantile: where the input probability is given as a float. (#188)
In Pharo 9, in cases like where the input probability is a Float and not a Fraction like
```
#(1 2 3 4 5) asSortedCollection quantile: 0.25
```
an error gets thrown as SortedCollection requires an Integer for a lookup. With the previous code
the value of the temporary value, `p`, could end up being a Float like `2.0` that would equal the integer
( i.e. `p truncate = p` ) but using `2.0` as an index no longer works.1 parent 1907ebe commit a392ade
File tree
2 files changed
+10
-1
lines changed- src
- Math-Quantile
- Math-Tests-Quantile
2 files changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
61 | 70 | | |
62 | 71 | | |
63 | 72 | | |
| |||
0 commit comments