Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb9c6491

Browse files
Update BinaryToDecimal.js
1 parent0e398bb commitb9c6491

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎Conversions/BinaryToDecimal.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
functionbinaryToDeicmal(binaryNumber){
22
letdecimalNumber=0
3-
constbinaryDigits=binaryNumber.split('').reverse()// Splits thebnary numberin revered single digits
3+
constbinaryDigits=binaryNumber.split('').reverse()// Splits thebinary numberinto reversed single digits
44
binaryDigits.forEach((binaryDigit,index)=>{
55
decimalNumber+=binaryDigit*(Math.pow(2,index))// Summation of all the decimal converted digits
66
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp