a port of the Processing Visualization Language
Name

byte()

Examples
char c = 'E';

b = byte(c);

println(c + " : " + b);  // Prints "E : 69"



int i = 130;

b = byte(i);

println(i + " : " + b);  // Prints "130 : -126"
Description Converts a primitive datatype or array to its byte representation. A byte can only be a whole number between -128 and 127, therefore when a number outside this range is converted, its value wraps to the corresponding byte representation.
Syntax
byte(val)
Parameters
val int, char, int[], char[]
Returns byte
Usage Web & Application
Related byte
int()

This reference is licensed under the CC BY-NC-SA 2.0 license:

Creative Commons License
Fork me on GitHub