summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-09-11 23:19:18 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-09-11 23:19:18 +0200
commit5b66b52623748f00ff1e48013b8136391454af57 (patch)
tree788d7cc8dae0232aab6a88cf7a6358d24e48ffd3 /sys
parentc0a9c3b551ed5d9b3a9d8389e36a3eb059662702 (diff)
libc: dont use floating point for portable umuldiv(), use 64 bit uvlong
Diffstat (limited to 'sys')
-rw-r--r--sys/src/libc/port/muldiv.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/src/libc/port/muldiv.c b/sys/src/libc/port/muldiv.c
index c304daf6e..748b31378 100644
--- 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