v8
8.1.307(node14.1.0)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Static Public Member Functions | |
static Local< BigInt > | New (Isolate *isolate, int64_t value) |
static Local< BigInt > | NewFromUnsigned (Isolate *isolate, uint64_t value) |
static MaybeLocal< BigInt > | NewFromWords (Local< Context > context, int sign_bit, int word_count, const uint64_t *words) |
static V8_INLINE BigInt * | Cast (v8::Value *obj) |
Static Public Member Functions inherited from Value | |
template<class T > | |
static V8_INLINE Value * | Cast (T *value) |
A JavaScript BigInt value (https://tc39.github.io/proposal-bigint)
int64_t Int64Value | ( | bool * | lossless = nullptr | ) | const |
|
static |
Creates a new BigInt object using a specified sign bit and a specified list of digits/words. The resulting number is calculated as:
(-1)^sign_bit * (words[0] * (2^64)^0 + words[1] * (2^64)^1 + ...)
void ToWordsArray | ( | int * | sign_bit, |
int * | word_count, | ||
uint64_t * | words | ||
) | const |
Writes the contents of this BigInt to a specified memory location. sign_bit
must be provided and will be set to 1 if this BigInt is negative. *word_count
has to be initialized to the length of the words
array. Upon return, it will be set to the actual number of words that would be needed to store this BigInt (i.e. the return value of WordCount()
).
uint64_t Uint64Value | ( | bool * | lossless = nullptr | ) | const |
int WordCount | ( | ) | const |
Returns the number of 64-bit words needed to store the result of ToWordsArray().