int_to_bin
fn int_to_bin(int n) -> string Import
Source: use conv::{int_to_bin}; src/conv.hy Formats n in binary without a prefix; a negative n gets a leading -.
Parameters#
| Name | Type |
|---|---|
n | int |
Returns#
string
Examples#
use conv::{int_to_bin};
use tests::assert;
assert!(int_to_bin(5) == "101");
See also#
int_to_dec: Formatsnin decimal; the same asformat("%i", n).int_to_hex: Formatsnin lowercase hexadecimal without a prefix; a negativengets a leading-.parse_int_radix: Parses an integer written in baseradix, which must be 10 or 16.parse_int: Parses a decimal integer, such as"42"," -7 "or"+3".parse_float: Parses a decimal float such as"3.5","-0.25","1e3"or"42".