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  

sq()

   
Examples  
noStroke(); 
float a = sq(1);   // Sets a to 1 
float b = sq(-5);  // Sets b to 25 
float c = sq(9);   // Sets c to 81 
rect(0, 25, a, 10); 
rect(0, 45, b, 10); 
rect(0, 65, c, 10); 
Description   Squares a number (multiplies a number by itself). The result is always a positive number, as multiplying two negative numbers always yields a positive result. For example, -1 * -1 = 1.
   
Syntax  
sq(value)
   
Parameters  
value   int or float

   
Returns   float
   
Usage   Web & Application
   
Related   sqrt()
 
 






   
 
Updated: Fri Jul 15 16:36:10 PDT 2005
 
 








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