shithub: sl

Download patch

ref: f54ecaea71cbf6bdc9a53fd3edd10aed893558e1
parent: da8010e37d56c8c2d0289b1ef465fb5b724a7ce9
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Wed Feb 5 23:07:43 EST 2025

define *_MAXINT in terms of *_MANT_DIG

--- a/src/builtins.c
+++ b/src/builtins.c
@@ -9,8 +9,8 @@
 #include "table.h"
 #include "nan.h"
 
-#define DBL_MAXINT (1LL<<53)
-#define FLT_MAXINT (1<<24)
+#define DBL_MAXINT (1LL<<DBL_MANT_DIG)
+#define FLT_MAXINT (1<<FLT_MANT_DIG)
 
 size_t
 llength(value_t v)
--- a/src/plan9/platform.h
+++ b/src/plan9/platform.h
@@ -76,6 +76,8 @@
 #define INT64_MAX 0x7fffffffffffffffLL
 #define UINT64_MAX 0xffffffffffffffffULL
 #define ULONG_MAX UINT32_MAX
+#define DBL_MANT_DIG 53
+#define FLT_MANT_DIG 24
 
 #define PATHSEP '/'
 #define PATHSEPSTRING "/"