ref: 2fc8b4c1d3bf00deb060b16e46d915fc5580fcd1
parent: 88edd57fedfdba84862030f6269ca67ebd121f77
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Sep 11 19:19:18 EDT 2016
libc: dont use floating point for portable umuldiv(), use 64 bit uvlong
--- a/sys/src/libc/port/muldiv.c
+++ b/sys/src/libc/port/muldiv.c
@@ -4,12 +4,7 @@
ulong
umuldiv(ulong a, ulong b, ulong c)
{- double d;
-
- d = ((double)a * (double)b) / (double)c;
- if(d >= 4294967296.)
- abort();
- return d;
+ return ((uvlong)a * (uvlong)b) / c;
}
long
--
⑨