Files
react-native/ReactCommon/jsi
John Porto a21a1f845b Add methods for creating and interacting with BigInt
Summary:
This change adds the following methods to jsi::BigInt

  * [static] fromInt64(value): creates a jsi::BigInt from a signed 64-bit value
  * [static] fromUint64(value): creates a jsi::BigInt from an unsigned 64-bit value
  * [static] strictEquals(a, b): return a === b, a and b are BigInts
  * asInt64(): truncates the BigInt to a single signed 64-bit integer; throws a JSIException if the truncation is lossy.
  * getInt64(): truncates the BigInt to a single signed 64-bit integer
  * isInt64(): returns true if the BigInt can be truncated losslessly to an int64_t
  * asUint64(): truncates the BigInt to a single unsigned 64-bit integer; throws a JSIException if the truncation is lossy.
  * getUint64(): truncates the BigInt to a single unsigned 64-bit integer
  * isUint64(): returns true if the BigInt can be truncated losslessly to an uint64_t
  * toString(radix): converts the BigInt to a string representing the number in the given radix.

 A lossy truncation is one that yields a result from which the BigInt cannot be reconstructed from, i.e.,
* BigInt::fromInt64(b.toInt64()) !== b
* BigInt::fromUint64(b.toUint64()) !== b

Changelog: [Internal]

Reviewed By: kodafb

Differential Revision: D37909139

fbshipit-source-id: 172848024f8367aed73cc602f38cde22f03cac8f
2022-07-29 07:55:57 -07:00
..
2022-04-05 12:15:05 -07:00
2022-03-16 08:10:55 -07:00