Math Type
Math Type
Math - Methods related to mathematical calculations
Static methods of Math type:
- BigDecimal.sqrt: Square root
- BigDecimal.abs: Absolute value
- BigDecimal.max: Returns the greater of two values
- BigDecimal.min: Returns the lesser of two values
- BigDecimal.ceil: Round up
- BigDecimal.floor: Round down
- BigDecimal.round: Round to nearest integer
Example:
log.info(Math.sqrt(16)) // Square root
log.info(Math.abs(-1)) // Absolute value
log.info(Math.max(10,16)) // Returns the greater of two values
log.info(Math.min(10,16)) // Returns the lesser of two values
log.info(Math.ceil(7.5 as double)) // Round up
log.info(Math.floor(7.9 as double)) // Round down
log.info(Math.round(7.5 as double)) // Round to nearest integer