Skip to content

Commit 5e3f771

Browse files
committed
Better rounding of last digit
1 parent 3547b4b commit 5e3f771

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/speculative.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ llama_tokens common_speculative_gen_draft(
157157
// Extract parameters packed in p_min (format: 0.pmin_pdecay_nmin)
158158
const float p_min = floorf(params.p_min * 100) / 100; // First 2 decimal places
159159
const float p_decay = floorf((params.p_min - p_min) * 10000) / 100; // Next 2 decimal places
160-
const int n_min = floorf((params.p_min - p_min - (p_decay / 100)) * 100000); // Last digit
160+
const int n_min = roundf((params.p_min - p_min - (p_decay / 100)) * 100000); // Last digit
161161

162162
printf("p_min=%f, p_decay=%f, n_min=%d\n", p_min, p_decay, n_min);
163163

0 commit comments

Comments
 (0)