Github Copilot - JavaScript gibt eine unterschiedliche binäre DarstellungJavaScript

Javascript-Forum
Anonymous
 Github Copilot - JavaScript gibt eine unterschiedliche binäre Darstellung

Post by Anonymous »

Aus meiner 64-Bit-Maschine erhalte ich ein bestimmtes Ergebnis mit dem folgenden JavaScript-Code < /p>
ein bestimmtes Ergebnis

Code: Select all

> const asBinary = BigInt(7306822938861727746).toString(2)
undefined
> asBinary
'110010101100111000011001011111111101011100001110111000000000000' -- (A)
< /code>
Das gleiche gleich, wenn er von Github Copilot ausprobiert wird.Me
Convert 7306822938861727746 to binary treating it as a 64-bit decimal

GitHub Copilot
The binary representation of 7306822938861727746 treated as a 64-bit decimal is:

0110010101011111010101101011110011111101000000000000000010 -- (B)

Me
Convert 7306822938861727746 to binary treating it as a BigInt in Javascript

GitHub Copilot
To convert 7306822938861727746 to binary treating it as a BigInt in JavaScript, you can use the following code:

const binaryRepresentation = BigInt("7306822938861727746").toString(2);
console.log(binaryRepresentation);// Output:
11001010101111101010110101111001111110100000000000000010  -- (C)
Github Copilot ist in seinen Antworten (b) und (c) konsistent, wenn Sie das führende Null in seinem ersten Ergebnis (b) ausschließen.>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post