This commit is contained in:
Justine Tunney 2024-06-26 14:18:37 +03:00 committed by GitHub
commit 4dd9017027
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1630,7 +1630,7 @@ void dequantize_row_q8_0(const block_q8_0 * restrict x, float * restrict y, int6
// ===================== Helper functions // ===================== Helper functions
// //
static inline int nearest_int(float fval) { static inline int nearest_int(float fval) {
assert(fval <= 4194303.f); fval = fminf(fval, 4194303.f);
float val = fval + 12582912.f; float val = fval + 12582912.f;
int i; memcpy(&i, &val, sizeof(int)); int i; memcpy(&i, &val, sizeof(int));
return (i & 0x007fffff) - 0x00400000; return (i & 0x007fffff) - 0x00400000;