Skip to content

Commit fd98eab

Browse files
authored
clamp last to infinity to handle rare imprecision issues (#1532)
1 parent 2e980ca commit fd98eab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libafl_bolts/src/math.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn calculate_cumulative_distribution_in_place(probabilities: &mut [f32]) ->
2929
}
3030

3131
// Clamp the end of the vector to account for floating point errors.
32-
*last = 1.0_f32;
32+
*last = f32::INFINITY;
3333

3434
Ok(())
3535
}

0 commit comments

Comments
 (0)