Ensure that lcm(a,b) returns the mathematically correct result,
provided it fits in an unsigned long. The current version returns
garbage if a*b overflows, even if the final result would fit.
Signed-off-by: Rasmus Villemoes
---
lib/lcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
dif
Rasmus Villemoes writes:
Ping...
> Ensure that lcm(a,b) returns the mathematically correct result,
> provided it fits in an unsigned long. The current version returns
> garbage if a*b overflows, even if the final result would fit.
>
> Signed-off-by: Rasmus Villemoes
> ---
> There are of course
Ensure that lcm(a,b) returns the mathematically correct result,
provided it fits in an unsigned long. The current version returns
garbage if a*b overflows, even if the final result would fit.
Signed-off-by: Rasmus Villemoes
---
There are of course still plenty of cases where the return value is
w
3 matches
Mail list logo