You are here

public static function PHPExcel_Calculation_Functions::IS_ODD in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Functions.php \PHPExcel_Calculation_Functions::IS_ODD()

* IS_ODD * *

Parameters

mixed $value Value to check: * @return boolean

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Functions.php, line 429

Class

PHPExcel_Calculation_Functions
PHPExcel_Calculation_Functions

Code

public static function IS_ODD($value = NULL) {
  $value = self::flattenSingleValue($value);
  if ($value === NULL) {
    return self::NAME();
  }
  if (is_bool($value) || is_string($value) && !is_numeric($value)) {
    return self::VALUE();
  }
  return abs($value) % 2 == 1;
}