#Whitespace (with vii5ard compiler), 1818 17 bytes
[S S S N
_Push_0][S N
S _Duplicate_0][T N
T T _Read_STDIN_as_integer][T T T _Retrieve_input][T N
S T _Print_as_integer]
Unfortunately this above doesn't work on TIO. It will give a no parse
error for two reasons (all Whitespace compilers are slightly different).. So, instead we'll read one character at a time, and stop (with an error) as soon as we've encountered the .
or there is no more input (i.e. 50
/-50
):
- It will give a
no parse
error when we try to read an input as integer, which isn't an a valid integer. So, instead we'll read one character at a time, and stop (with an error) as soon as we've encountered the .
or there is no more input (i.e. 50
/-50
).
- In the vii5ard compiler it's also possible to push 0 with just
SSN
, whereas on TIO it requires an additional S
or T
: SSSN
/SSTN
. The first S
is Enable Stack Manipulation; the second S
is Push what follows as integer; the third S
/T
is positive/negative respectively; and any S
/T
after that (followed by an N
) is the number we want to push in binary, where S=0
and T=1
. For integer 0 this binary part doesn't matter, since it's 0 by default. But on TIO we'd still have to specify the positive/negative, and with most other Whitespace compilers like vii5ard not.