pitrou commented on code in PR #379:
URL: https://github.com/apache/arrow-js/pull/379#discussion_r2783770345


##########
test/unit/vector/interval-month-day-nano-tests.ts:
##########
@@ -77,4 +78,39 @@ describe(`MonthDayNanoIntervalVector`, () => {
         expect(vec.get(0)).toStrictEqual(array);
         expect(toIntervalMonthDayNanoObjects(vec.get(0), 
false)).toStrictEqual([{ ...EMPTY_INTERVAL_MONTH_DAY_NANO_OBJECT, ...obj }]);
     });
+
+    test(`Unsafe integer nanoseconds parsed as numbers roundtrip correctly`, 
() => {
+        const samples = [
+            '-390122861233460600',
+            '6684525287992311000'
+        ];
+        for (const sample of samples) {
+            const nanoseconds = Number.parseFloat(sample);

Review Comment:
   This seems incorrect since that will introduce FP inaccuracies. You need 
something like `BigInt(sample)`.
   
   For example `console.log(BigInt(Number.parseFloat("-390122861233460600")));` 
gives me `-390122861233460608n`.
   



-- 
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]

Reply via email to