shithub: util

Download patch

ref: 947c5612d5d6aadc6e8b44911e977568d364dc3d
parent: 1ee40b966070c372cd1a7c51ee435b784ba2bbf4
author: eli <eli@singularity>
date: Sun Sep 21 04:20:35 EDT 2025

comparison in rounding function...?

--- a/llama2.c
+++ b/llama2.c
@@ -166,15 +166,15 @@
 
 	fract = modf(in, &in);
 
-	if (in >= 0.0) {
-		if (fract < 0.5)
+	if (in < 0.0) {
+		if (fract > -0.5)
 			return in;
-		return (in + 1.0);
+		return (in - 1.0);
 	}
 
-	if (fract > -0.5)
+	if (fract < 0.5)
 		return in;
-	return (in - 1.0);
+	return (in + 1.0);
 }
 
 // ----------------------------------------------------------------------------
--