From 36117f59ec77784c9ef77801d7c1cbf03a4c4a8b Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Thu, 7 May 2020 15:35:06 -0700 Subject: wrap: elementary math functions for libmath --- sys/libn/random.c | 2 +- sys/libn/string.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/libn') diff --git a/sys/libn/random.c b/sys/libn/random.c index 1e2c2d5..558641e 100644 --- a/sys/libn/random.c +++ b/sys/libn/random.c @@ -69,7 +69,7 @@ double rngĀ·random() { uint64 r = xoshiro256ss(&RNG); - return (double)r / UINT64_MAX; + return (double)r / (double)UINT64_MAX; } /* Returns true or false on success of trial */ diff --git a/sys/libn/string.c b/sys/libn/string.c index 4280e27..ca53bdc 100644 --- a/sys/libn/string.c +++ b/sys/libn/string.c @@ -180,6 +180,7 @@ strĀ·makecap(const byte* s, vlong len, vlong cap) cleanup: free(h); panicf("Attempted to create a string with less capacity than length"); + return nil; } // New returns a new dynamic string object, initialized from the given C string. -- cgit v1.2.1