Candy, 2 bytes
Hn
H stands for Heisen-double
n stands for not
The 'n' is passed with the -i flag as numeric input. Values left on the stack are printed on exit.
"Long" form:
rand # number between 0 and pop()
not # cast to int, invert non-zero to zero, and zero to one