number type represents only it's value.
number type has only one integer with multiple representations. (hence why doing bit manipulations in java script overrides the whole concept of using the language representation of the value of a number. e.g. is number all zero's except of last bit a float, an integer, or a boolean?)
With BigInts, you can safely store and operate on large integers even beyond the safe integer limit for Numbers. A BigInt is not strictly equal to a Number, but it is loosely so.
Two's compilment is a numeric encoding scheme, not a numberic value. Messing with an encoding scheme means directly manipulating bits. Not safe to do in java script because of behind the scenes / hidden from programmer using java script language type coersions.
Was what interprets/runs java script on a given machine compiled as 64bit program or 32bit program?
Hence, is javascript number an actual 32bits, actual 64bits, or is a 64bit value a 32bit with bigint extensions behind the scenes.
During the execution of a javescript, is a check to see which java version (old / new) is being used done before doing 32/64bit bit manipulations so there are no "is it safe to use bit manipulations with bigints"
hint: The reason why javascript can nolonger safely represent integers (not integer values).
> No, java script has two built in number types, number and bigint
BigInt is a new feature, I am only talking about Number. Hence “old”.
In the ECMAScript 3 specification (and later versions), it's specified that the bitwise operators convert the value to a 32-bit signed integer, with two's-complement wraparound behaviour. The input (Number) and output (Number) is notionally a 64-bit float, but this doesn't mean there aren't integer operations. And in fact in any modern JS engine, integer values of this kind will be stored as integers, not floats, for efficiency's sake.
There is an entire 32-bit C-compatible abstract machine (asm.js) built on top of this primitive!
number type represents only it's value. number type has only one integer with multiple representations. (hence why doing bit manipulations in java script overrides the whole concept of using the language representation of the value of a number. e.g. is number all zero's except of last bit a float, an integer, or a boolean?)
With BigInts, you can safely store and operate on large integers even beyond the safe integer limit for Numbers. A BigInt is not strictly equal to a Number, but it is loosely so.
Two's compilment is a numeric encoding scheme, not a numberic value. Messing with an encoding scheme means directly manipulating bits. Not safe to do in java script because of behind the scenes / hidden from programmer using java script language type coersions.
****
Ah 'weak/strong type' is pretty vague (https://stackoverflow.com/questions/430182/is-c-strongly-typ... && https://stackoverflow.com/questions/376611/why-interpreted-l... )
scripting (java script) is dynamically typed.
compiled C is staticly typed.
C++ can infer types at runtime.
**
Was what interprets/runs java script on a given machine compiled as 64bit program or 32bit program?
Hence, is javascript number an actual 32bits, actual 64bits, or is a 64bit value a 32bit with bigint extensions behind the scenes.
During the execution of a javescript, is a check to see which java version (old / new) is being used done before doing 32/64bit bit manipulations so there are no "is it safe to use bit manipulations with bigints" hint: The reason why javascript can nolonger safely represent integers (not integer values).