Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit686d399

Browse files
committed
Fix non-portable use of round().
round() is from C99. Use rint() instead. There are behavioraldifferences between round() and rint(), but they should not matter tothe Bloom filter optimal_k() function. We already assume POSIXbehavior for rint(), so there is no question of rint() not using"rounds towards nearest" as its rounding mode.Cleanup from commit51bc271.Per buildfarm member thrips.Author: Peter GeogheganDiscussion:https://postgr.es/m/CAH2-Wzn76eCGUonARy-wrVtMHsf+4cvbK_oJAWTLfORTU5ki0w@mail.gmail.com
1 parent7f563c0 commit686d399

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/lib/bloomfilter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ my_bloom_power(uint64 target_bitset_bits)
240240
staticint
241241
optimal_k(uint64bitset_bits,int64total_elems)
242242
{
243-
intk=round(log(2.0)*bitset_bits /total_elems);
243+
intk=rint(log(2.0)*bitset_bits /total_elems);
244244

245245
returnMax(1,Min(k,MAX_HASH_FUNCS));
246246
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp