get Pi and round it up and down : FLOOR « Math « SQL / MySQL






get Pi and round it up and down

       
mysql>
mysql> SELECT PI(), CEILING(PI()), FLOOR(PI());
+----------+---------------+-------------+
| PI()     | CEILING(PI()) | FLOOR(PI()) |
+----------+---------------+-------------+
| 3.141593 |             4 |           3 |
+----------+---------------+-------------+
1 row in set (0.00 sec)

mysql>
mysql>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Retrieve the largest integer that is not greater than a specified value: FLOOR()
2.Use FLOOR( ) if you prefer integer values to floating-point values:
3.Try multiplying the FLOOR( ) results by five:
4.To put each population value in the proper category, divide by five million and use the integer result