Skip to content

Commit b50a5a2

Browse files
authored
Improve clamp generic in mandelbrot example (#18)
1 parent f1f6930 commit b50a5a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mandelbrot/assembly/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ export function computeLine(y: u32, width: u32, height: u32, limit: u32): void {
5151

5252
/** Clamps a value between the given minimum and maximum. */
5353
@inline
54-
function clamp<T>(value: T, minValue: T, maxValue: T): T {
54+
function clamp<T extends number>(value: T, minValue: T, maxValue: T): T {
5555
return min(max(value, minValue), maxValue);
5656
}

0 commit comments

Comments
 (0)