b2d
A binary number to decimal number converter. Attempt to do so recursively through the use of join blocks. However, due to join and replace blocks not being able to insert right parentheses (they *can*, but only with a left one prior, which conversely can't be removed without also removing the pair), this tag is not truly recursive, because of the need to manually add right parentheses through the use of list blocks. Right parentheses are necessary to maintain the order of operations for the equation. The other mathematical way to convert binary to decimal is not conducive to join/replace, because it requires the exponent to be based off positional information of the element, and join/replace cannot deliver mutable data or variables that differ based on insertion point.
Content
9 lines{=(binary):{args}}
{=(spaced):{join( ):{replace(, ):{binary}}}}
{=(length):{m:trunc({index(end):{spaced} end})}}
{=(tilde):{join(~):{spaced}}}
{=(rbed):{list(0):{tilde}}) {list(1):{tilde}}) {list(2):{tilde}}) {list(3):{tilde}}) {list(4):{tilde}}) {list(5):{tilde}}) {list(6):{tilde}}) {list(7):{tilde}}) {list(8):{tilde}}) {list(9):{tilde}}) {list(10):{tilde}}) {list(11):{tilde}}) {list(12):{tilde}}) {list(13):{tilde}}) {list(14):{tilde}}) {list(15):{tilde}}) {list(16):{tilde}}) {list(17):{tilde}}) {list(18):{tilde}}) {list(19):{tilde}}) {list(20):{tilde}}) {list(21):{tilde}}) {list(22):{tilde}}) {list(23):{tilde}}) {list(24):{tilde}}) {list(25):{tilde}}) {list(26):{tilde}}) {list(27):{tilde}}) {list(28):{tilde}}) {list(29):{tilde}}) {list(30):{tilde}}) {list(31):{tilde}}) {list(32):{tilde}}) {list(33):{tilde}}) {list(34):{tilde}}) {list(35):{tilde}}) {list(36):{tilde}}) {list(37):{tilde}}) {list(38):{tilde}}) {list(39):{tilde}})}
{=(LM1):{m:trunc({length}-1)}}
{=(lbs):( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( (}
{if({m:sgn({replace(1,0):{join(+):{spaced}}})}!=0):Your input was not a binary number.|Binary: `{args}`
Decimal: `{m:trunc({join():{lbs(+{LM1})}}{join(*2+):{rbed(+{length}):)}})}`}Raw JSON
{
"id": 841885,
"created_at": "2021-05-22T12:13:53.000Z",
"tag_name": "b2d",
"nsfw": false,
"owner_id": "129419437911572480",
"uses": 11,
"description": "A binary number to decimal number converter. Attempt to do so recursively through the use of join blocks. However, due to join and replace blocks not being able to insert right parentheses (they *can*, but only with a left one prior, which conversely can't be removed without also removing the pair), this tag is not truly recursive, because of the need to manually add right parentheses through the use of list blocks. Right parentheses are necessary to maintain the order of operations for the equation. The other mathematical way to convert binary to decimal is not conducive to join/replace, because it requires the exponent to be based off positional information of the element, and join/replace cannot deliver mutable data or variables that differ based on insertion point.",
"restricted": false,
"shared": false,
"deleted": false,
"safe": "unrated",
"hidden": false,
"guild_id": "632187193162465281",
"sharer": "129419437911572480",
"content": "{=(binary):{args}}\n{=(spaced):{join( ):{replace(, ):{binary}}}}\n{=(length):{m:trunc({index(end):{spaced} end})}}\n{=(tilde):{join(~):{spaced}}}\n{=(rbed):{list(0):{tilde}}) {list(1):{tilde}}) {list(2):{tilde}}) {list(3):{tilde}}) {list(4):{tilde}}) {list(5):{tilde}}) {list(6):{tilde}}) {list(7):{tilde}}) {list(8):{tilde}}) {list(9):{tilde}}) {list(10):{tilde}}) {list(11):{tilde}}) {list(12):{tilde}}) {list(13):{tilde}}) {list(14):{tilde}}) {list(15):{tilde}}) {list(16):{tilde}}) {list(17):{tilde}}) {list(18):{tilde}}) {list(19):{tilde}}) {list(20):{tilde}}) {list(21):{tilde}}) {list(22):{tilde}}) {list(23):{tilde}}) {list(24):{tilde}}) {list(25):{tilde}}) {list(26):{tilde}}) {list(27):{tilde}}) {list(28):{tilde}}) {list(29):{tilde}}) {list(30):{tilde}}) {list(31):{tilde}}) {list(32):{tilde}}) {list(33):{tilde}}) {list(34):{tilde}}) {list(35):{tilde}}) {list(36):{tilde}}) {list(37):{tilde}}) {list(38):{tilde}}) {list(39):{tilde}})}\n{=(LM1):{m:trunc({length}-1)}}\n{=(lbs):( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( (}\n{if({m:sgn({replace(1,0):{join(+):{spaced}}})}!=0):Your input was not a binary number.|Binary: `{args}`\nDecimal: `{m:trunc({join():{lbs(+{LM1})}}{join(*2+):{rbed(+{length}):)}})}`}",
"embed": "{}",
"last_fetched": "2026-10-21T01:34:31.690Z"
}