FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Name  

byte()

   
Examples  
float f = 65.0; 
byte b = byte(f); 
println(f + " : " + b);  // Prints "65.0 : 65" 
 
char c = 'E'; 
b = byte(c); 
println(c + " : " + b);  // Prints "E : 69" 
 
f = 130.0; 
b = byte(f); 
println(f + " : " + b);  // Prints "130.0 : -126" 

Description   Converts a primitive datatype, string, 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, float, char, boolean, String, int[], float[], char[], boolean[], String[]

   
Returns   byte
   
Usage   Web & Application
   
Related   byte
int()
 
 






   
 
Updated: Fri Jul 15 16:35:33 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info