ayush00git commented on code in PR #3253:
URL: https://github.com/apache/fory/pull/3253#discussion_r2775089798


##########
javascript/packages/fory/lib/writer/number.ts:
##########
@@ -36,11 +36,9 @@ export function toFloat16(value: number) {
   }
 
   if (exponent < -14) {
-    return sign | 0x3ff; // returns ±max subnormal
-  }
-
-  if (exponent <= 0) {
-    return sign | ((significand | 0x800000) >> (1 - exponent + 10));
+    // subnormal

Review Comment:
   I removed that block so that exponents between -14 and 0 correctly fall 
through to the normalized handling logic at the end of the function. The 
removed block if (exponent <= 0) was incorrectly classifying normalized numbers 
as subnormal.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to