Skip to content

Commit df2348a

Browse files
committed
fix: reject non-positive bins
1 parent 2931928 commit df2348a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/utils/bin.typ

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
let n-bins = if binwidth != none and binwidth > 0 {
2222
calc.max(1, int(calc.ceil((hi - lo) / binwidth)))
2323
} else {
24+
assert(
25+
bins != none and bins > 0,
26+
message: "bins must be a positive integer; got " + repr(bins),
27+
)
2428
bins
2529
}
2630
(n-bins: n-bins, width: (hi - lo) / n-bins)

0 commit comments

Comments
 (0)