From b1c682279994fd35a590a925a0f51647771d2002 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 24 Jul 2017 22:41:40 +0200 Subject: [PATCH] mood.c: Fix documentation of int_sqrt(). As pointed out by Peter Zijlstra on lkml, int_sqrt() is not rough nor any approximation; it calculates the exact value of floor(sqrt()). Document this. --- mood.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mood.c b/mood.c index c24b3d8b..bf6b3c9c 100644 --- a/mood.c +++ b/mood.c @@ -121,10 +121,9 @@ __a_const static uint32_t fls64(uint64_t v) } /* - * Rough approximation to sqrt. + * Compute the integer square root floor(sqrt(x)). * - * It returns an integer res with res * res <= x. Taken 2007 from the linux - * source tree. + * Taken 2007 from the linux source tree. */ __a_const static uint64_t int_sqrt(uint64_t x) { -- 2.30.2