trxcllnt commented on code in PR #35067:
URL: https://github.com/apache/arrow/pull/35067#discussion_r1165970302
##########
js/src/util/bn.ts:
##########
@@ -90,12 +90,52 @@ function bignumToNumber<T extends BN<BigNumArray>>(bn: T) {
}
/** @ignore */
-export const bignumToString: { <T extends BN<BigNumArray>>(a: T): string } =
(<T extends BN<BigNumArray>>(a: T) => a.byteLength === 8 ? `${new
a['BigIntArray'](a.buffer, a.byteOffset, 1)[0]}` : decimalToString(a));
+export const bigNumToString: { <T extends BN<BigNumArray>>(a: T): string } =
(<T extends BN<BigNumArray>>(a: T) => {
+ // use BigInt native implementation
+ if (a.byteLength === 8) {
+ const bigIntArray = new a['BigIntArray'](a.buffer, a.byteOffset, 1);
+ return `${bigIntArray[0]}`;
+ }
+
+ // unsigned numbers
+ if (!a.signed) {
Review Comment:
```suggestion
if (!a['signed']) {
```
--
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]