Language \ Environment \ Comparison
 
Index
 
  The Processing 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: reas at groupc.net
Name  

abs()

   
Examples  
int a = abs(153);      // Sets a to 153 
int b = abs(-15);      // Sets b to 15 
float c = abs(12.234); // Sets c to 12.234 
float d = abs(-9.23);  // Sets d to 9.23 

Description   Calculates the absolute value (magnitude) of a number. The absolute value of a number is always positive.
   
Syntax  
abs(value)
   
Parameters  
value   float or int

   
Returns   float or int (depending on the input values)
   
Usage   Web & Application
   
   
© 2004 - 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea
Processing is an open project initiated by Ben Fry and Casey Reas