Name | binary() |
||||
---|---|---|---|---|---|
Examples |
c = color(255, 204, 0) print(c) # Prints "-13312" print(binary(c)) # Prints "11111111111111111100110000000000" print(binary(c, 16)) # Prints "1100110000000000" | ||||
Description |
Converts a byte, char, int, or color to a String containing the equivalent binary notation. For example, the color value produced by color(0, 102, 153, 255) will convert to the String value "11111111000000000110011010011001". This function can help make your geeky debugging sessions much happier. Note that the maximum number of digits is 32, because an int value can only represent up to 32 bits. Specifying more than 32 digits will have no effect. |
||||
Syntax | binary(value) binary(value, digits) | ||||
Parameters |
| ||||
Related |
unbinary() hex() unhex() |
Updated on Mon Sep 21 15:53:24 2020.
If you see any errors or have comments, please let us know.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License