Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

(no description)

File Size: 2807 lines (102 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Engineering:: (66 methods):
  parseComplex()
  nbrConversionFormat()
  BESSELI()
  BESSELJ()
  besselK0()
  besselK1()
  BESSELK()
  besselY0()
  besselY1()
  BESSELY()
  BINTODEC()
  BINTOHEX()
  BINTOOCT()
  DECTOBIN()
  DECTOHEX()
  DECTOOCT()
  HEXTOBIN()
  HEXTODEC()
  HEXTOOCT()
  OCTTOBIN()
  OCTTODEC()
  OCTTOHEX()
  COMPLEX()
  IMAGINARY()
  IMREAL()
  IMABS()
  IMARGUMENT()
  IMCONJUGATE()
  IMCOS()
  IMCOSH()
  IMCOT()
  IMCSC()
  IMCSCH()
  IMSIN()
  IMSINH()
  IMSEC()
  IMSECH()
  IMTAN()
  IMSQRT()
  IMLN()
  IMLOG10()
  IMLOG2()
  IMEXP()
  IMPOWER()
  IMDIV()
  IMSUB()
  IMSUM()
  IMPRODUCT()
  DELTA()
  GESTEP()
  erfVal()
  validateBitwiseArgument()
  BITAND()
  BITOR()
  BITXOR()
  BITLSHIFT()
  BITRSHIFT()
  ERF()
  ERFPRECISE()
  erfcVal()
  ERFC()
  getConversionGroups()
  getConversionGroupUnits()
  getConversionGroupUnitDetails()
  getConversionMultipliers()
  CONVERTUOM()


Class: Engineering  - X-Ref

parseComplex($complexNumber)   X-Ref
parseComplex.

Parses a complex number into its real and imaginary parts, and an I or J suffix

param: string $complexNumber The complex number
return: mixed[] Indexed on "real", "imaginary" and "suffix"

nbrConversionFormat($xVal, $places)   X-Ref
Formats a number base string value with leading zeroes.

param: string $xVal The "number" to pad
param: int $places The length that we want to pad this value
return: string The padded "number"

BESSELI($x, $ord)   X-Ref
BESSELI.

Returns the modified Bessel function In(x), which is equivalent to the Bessel function evaluated
for purely imaginary arguments

Excel Function:
BESSELI(x,ord)

param: float $x The value at which to evaluate the function.
param: int $ord The order of the Bessel function.
return: float

BESSELJ($x, $ord)   X-Ref
BESSELJ.

Returns the Bessel function

Excel Function:
BESSELJ(x,ord)

param: float $x The value at which to evaluate the function.
param: int $ord The order of the Bessel function. If n is not an integer, it is truncated.
return: float

besselK0($fNum)   X-Ref
No description

besselK1($fNum)   X-Ref
No description

BESSELK($x, $ord)   X-Ref
BESSELK.

Returns the modified Bessel function Kn(x), which is equivalent to the Bessel functions evaluated
for purely imaginary arguments.

Excel Function:
BESSELK(x,ord)

param: float $x The value at which to evaluate the function.
param: int $ord The order of the Bessel function. If n is not an integer, it is truncated.
return: float

besselY0($fNum)   X-Ref
No description

besselY1($fNum)   X-Ref
No description

BESSELY($x, $ord)   X-Ref
BESSELY.

Returns the Bessel function, which is also called the Weber function or the Neumann function.

Excel Function:
BESSELY(x,ord)

param: float $x The value at which to evaluate the function.
param: int $ord The order of the Bessel function. If n is not an integer, it is truncated.
return: float

BINTODEC($x)   X-Ref
BINTODEC.

Return a binary value as decimal.

Excel Function:
BIN2DEC(x)

param: string $x The binary number (as a string) that you want to convert. The number
return: string

BINTOHEX($x, $places = null)   X-Ref
BINTOHEX.

Return a binary value as hex.

Excel Function:
BIN2HEX(x[,places])

param: string $x The binary number (as a string) that you want to convert. The number
param: int $places The number of characters to use. If places is omitted, BIN2HEX uses the
return: string

BINTOOCT($x, $places = null)   X-Ref
BINTOOCT.

Return a binary value as octal.

Excel Function:
BIN2OCT(x[,places])

param: string $x The binary number (as a string) that you want to convert. The number
param: int $places The number of characters to use. If places is omitted, BIN2OCT uses the
return: string

DECTOBIN($x, $places = null)   X-Ref
DECTOBIN.

Return a decimal value as binary.

Excel Function:
DEC2BIN(x[,places])

param: string $x The decimal integer you want to convert. If number is negative,
param: int $places The number of characters to use. If places is omitted, DEC2BIN uses
return: string

DECTOHEX($x, $places = null)   X-Ref
DECTOHEX.

Return a decimal value as hex.

Excel Function:
DEC2HEX(x[,places])

param: string $x The decimal integer you want to convert. If number is negative,
param: int $places The number of characters to use. If places is omitted, DEC2HEX uses
return: string

DECTOOCT($x, $places = null)   X-Ref
DECTOOCT.

Return an decimal value as octal.

Excel Function:
DEC2OCT(x[,places])

param: string $x The decimal integer you want to convert. If number is negative,
param: int $places The number of characters to use. If places is omitted, DEC2OCT uses
return: string

HEXTOBIN($x, $places = null)   X-Ref
HEXTOBIN.

Return a hex value as binary.

Excel Function:
HEX2BIN(x[,places])

param: string $x the hexadecimal number you want to convert.
param: int $places The number of characters to use. If places is omitted,
return: string

HEXTODEC($x)   X-Ref
HEXTODEC.

Return a hex value as decimal.

Excel Function:
HEX2DEC(x)

param: string $x The hexadecimal number you want to convert. This number cannot
return: string

HEXTOOCT($x, $places = null)   X-Ref
HEXTOOCT.

Return a hex value as octal.

Excel Function:
HEX2OCT(x[,places])

param: string $x The hexadecimal number you want to convert. Number cannot
param: int $places The number of characters to use. If places is omitted, HEX2OCT
return: string

OCTTOBIN($x, $places = null)   X-Ref
OCTTOBIN.

Return an octal value as binary.

Excel Function:
OCT2BIN(x[,places])

param: string $x The octal number you want to convert. Number may not
param: int $places The number of characters to use. If places is omitted,
return: string

OCTTODEC($x)   X-Ref
OCTTODEC.

Return an octal value as decimal.

Excel Function:
OCT2DEC(x)

param: string $x The octal number you want to convert. Number may not contain
return: string

OCTTOHEX($x, $places = null)   X-Ref
OCTTOHEX.

Return an octal value as hex.

Excel Function:
OCT2HEX(x[,places])

param: string $x The octal number you want to convert. Number may not contain
param: int $places The number of characters to use. If places is omitted, OCT2HEX
return: string

COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i')   X-Ref
COMPLEX.

Converts real and imaginary coefficients into a complex number of the form x +/- yi or x +/- yj.

Excel Function:
COMPLEX(realNumber,imaginary[,suffix])

param: float $realNumber the real coefficient of the complex number
param: float $imaginary the imaginary coefficient of the complex number
param: string $suffix The suffix for the imaginary component of the complex number.
return: string

IMAGINARY($complexNumber)   X-Ref
IMAGINARY.

Returns the imaginary coefficient of a complex number in x + yi or x + yj text format.

Excel Function:
IMAGINARY(complexNumber)

param: string $complexNumber the complex number for which you want the imaginary
return: float

IMREAL($complexNumber)   X-Ref
IMREAL.

Returns the real coefficient of a complex number in x + yi or x + yj text format.

Excel Function:
IMREAL(complexNumber)

param: string $complexNumber the complex number for which you want the real coefficient
return: float

IMABS($complexNumber)   X-Ref
IMABS.

Returns the absolute value (modulus) of a complex number in x + yi or x + yj text format.

Excel Function:
IMABS(complexNumber)

param: string $complexNumber the complex number for which you want the absolute value
return: float

IMARGUMENT($complexNumber)   X-Ref
IMARGUMENT.

Returns the argument theta of a complex number, i.e. the angle in radians from the real
axis to the representation of the number in polar coordinates.

Excel Function:
IMARGUMENT(complexNumber)

param: string $complexNumber the complex number for which you want the argument theta
return: float|string

IMCONJUGATE($complexNumber)   X-Ref
IMCONJUGATE.

Returns the complex conjugate of a complex number in x + yi or x + yj text format.

Excel Function:
IMCONJUGATE(complexNumber)

param: string $complexNumber the complex number for which you want the conjugate
return: string

IMCOS($complexNumber)   X-Ref
IMCOS.

Returns the cosine of a complex number in x + yi or x + yj text format.

Excel Function:
IMCOS(complexNumber)

param: string $complexNumber the complex number for which you want the cosine
return: float|string

IMCOSH($complexNumber)   X-Ref
IMCOSH.

Returns the hyperbolic cosine of a complex number in x + yi or x + yj text format.

Excel Function:
IMCOSH(complexNumber)

param: string $complexNumber the complex number for which you want the hyperbolic cosine
return: float|string

IMCOT($complexNumber)   X-Ref
IMCOT.

Returns the cotangent of a complex number in x + yi or x + yj text format.

Excel Function:
IMCOT(complexNumber)

param: string $complexNumber the complex number for which you want the cotangent
return: float|string

IMCSC($complexNumber)   X-Ref
IMCSC.

Returns the cosecant of a complex number in x + yi or x + yj text format.

Excel Function:
IMCSC(complexNumber)

param: string $complexNumber the complex number for which you want the cosecant
return: float|string

IMCSCH($complexNumber)   X-Ref
IMCSCH.

Returns the hyperbolic cosecant of a complex number in x + yi or x + yj text format.

Excel Function:
IMCSCH(complexNumber)

param: string $complexNumber the complex number for which you want the hyperbolic cosecant
return: float|string

IMSIN($complexNumber)   X-Ref
IMSIN.

Returns the sine of a complex number in x + yi or x + yj text format.

Excel Function:
IMSIN(complexNumber)

param: string $complexNumber the complex number for which you want the sine
return: float|string

IMSINH($complexNumber)   X-Ref
IMSINH.

Returns the hyperbolic sine of a complex number in x + yi or x + yj text format.

Excel Function:
IMSINH(complexNumber)

param: string $complexNumber the complex number for which you want the hyperbolic sine
return: float|string

IMSEC($complexNumber)   X-Ref
IMSEC.

Returns the secant of a complex number in x + yi or x + yj text format.

Excel Function:
IMSEC(complexNumber)

param: string $complexNumber the complex number for which you want the secant
return: float|string

IMSECH($complexNumber)   X-Ref
IMSECH.

Returns the hyperbolic secant of a complex number in x + yi or x + yj text format.

Excel Function:
IMSECH(complexNumber)

param: string $complexNumber the complex number for which you want the hyperbolic secant
return: float|string

IMTAN($complexNumber)   X-Ref
IMTAN.

Returns the tangent of a complex number in x + yi or x + yj text format.

Excel Function:
IMTAN(complexNumber)

param: string $complexNumber the complex number for which you want the tangent
return: float|string

IMSQRT($complexNumber)   X-Ref
IMSQRT.

Returns the square root of a complex number in x + yi or x + yj text format.

Excel Function:
IMSQRT(complexNumber)

param: string $complexNumber the complex number for which you want the square root
return: string

IMLN($complexNumber)   X-Ref
IMLN.

Returns the natural logarithm of a complex number in x + yi or x + yj text format.

Excel Function:
IMLN(complexNumber)

param: string $complexNumber the complex number for which you want the natural logarithm
return: string

IMLOG10($complexNumber)   X-Ref
IMLOG10.

Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format.

Excel Function:
IMLOG10(complexNumber)

param: string $complexNumber the complex number for which you want the common logarithm
return: string

IMLOG2($complexNumber)   X-Ref
IMLOG2.

Returns the base-2 logarithm of a complex number in x + yi or x + yj text format.

Excel Function:
IMLOG2(complexNumber)

param: string $complexNumber the complex number for which you want the base-2 logarithm
return: string

IMEXP($complexNumber)   X-Ref
IMEXP.

Returns the exponential of a complex number in x + yi or x + yj text format.

Excel Function:
IMEXP(complexNumber)

param: string $complexNumber the complex number for which you want the exponential
return: string

IMPOWER($complexNumber, $realNumber)   X-Ref
IMPOWER.

Returns a complex number in x + yi or x + yj text format raised to a power.

Excel Function:
IMPOWER(complexNumber,realNumber)

param: string $complexNumber the complex number you want to raise to a power
param: float $realNumber the power to which you want to raise the complex number
return: string

IMDIV($complexDividend, $complexDivisor)   X-Ref
IMDIV.

Returns the quotient of two complex numbers in x + yi or x + yj text format.

Excel Function:
IMDIV(complexDividend,complexDivisor)

param: string $complexDividend the complex numerator or dividend
param: string $complexDivisor the complex denominator or divisor
return: string

IMSUB($complexNumber1, $complexNumber2)   X-Ref
IMSUB.

Returns the difference of two complex numbers in x + yi or x + yj text format.

Excel Function:
IMSUB(complexNumber1,complexNumber2)

param: string $complexNumber1 the complex number from which to subtract complexNumber2
param: string $complexNumber2 the complex number to subtract from complexNumber1
return: string

IMSUM(...$complexNumbers)   X-Ref
IMSUM.

Returns the sum of two or more complex numbers in x + yi or x + yj text format.

Excel Function:
IMSUM(complexNumber[,complexNumber[,...]])

param: string ...$complexNumbers Series of complex numbers to add
return: string

IMPRODUCT(...$complexNumbers)   X-Ref
IMPRODUCT.

Returns the product of two or more complex numbers in x + yi or x + yj text format.

Excel Function:
IMPRODUCT(complexNumber[,complexNumber[,...]])

param: string ...$complexNumbers Series of complex numbers to multiply
return: string

DELTA($a, $b = 0)   X-Ref
DELTA.

Tests whether two values are equal. Returns 1 if number1 = number2; returns 0 otherwise.
Use this function to filter a set of values. For example, by summing several DELTA
functions you calculate the count of equal pairs. This function is also known as the
Kronecker Delta function.

Excel Function:
DELTA(a[,b])

param: float $a the first number
param: float $b The second number. If omitted, b is assumed to be zero.
return: int

GESTEP($number, $step = 0)   X-Ref
GESTEP.

Excel Function:
GESTEP(number[,step])

Returns 1 if number >= step; returns 0 (zero) otherwise
Use this function to filter a set of values. For example, by summing several GESTEP
functions you calculate the count of values that exceed a threshold.

param: float $number the value to test against step
param: float $step The threshold value.
return: int

erfVal($x)   X-Ref
No description

validateBitwiseArgument($value)   X-Ref
Validate arguments passed to the bitwise functions.

param: mixed $value
return: int

BITAND($number1, $number2)   X-Ref
BITAND.

Returns the bitwise AND of two integer values.

Excel Function:
BITAND(number1, number2)

param: int $number1
param: int $number2
return: int|string

BITOR($number1, $number2)   X-Ref
BITOR.

Returns the bitwise OR of two integer values.

Excel Function:
BITOR(number1, number2)

param: int $number1
param: int $number2
return: int|string

BITXOR($number1, $number2)   X-Ref
BITXOR.

Returns the bitwise XOR of two integer values.

Excel Function:
BITXOR(number1, number2)

param: int $number1
param: int $number2
return: int|string

BITLSHIFT($number, $shiftAmount)   X-Ref
BITLSHIFT.

Returns the number value shifted left by shift_amount bits.

Excel Function:
BITLSHIFT(number, shift_amount)

param: int $number
param: int $shiftAmount
return: int|string

BITRSHIFT($number, $shiftAmount)   X-Ref
BITRSHIFT.

Returns the number value shifted right by shift_amount bits.

Excel Function:
BITRSHIFT(number, shift_amount)

param: int $number
param: int $shiftAmount
return: int|string

ERF($lower, $upper = null)   X-Ref
ERF.

Returns the error function integrated between the lower and upper bound arguments.

Note: In Excel 2007 or earlier, if you input a negative value for the upper or lower bound arguments,
the function would return a #NUM! error. However, in Excel 2010, the function algorithm was
improved, so that it can now calculate the function for both positive and negative ranges.
PhpSpreadsheet follows Excel 2010 behaviour, and accepts negative arguments.

Excel Function:
ERF(lower[,upper])

param: float $lower lower bound for integrating ERF
param: float $upper upper bound for integrating ERF.
return: float|string

ERFPRECISE($limit)   X-Ref
ERFPRECISE.

Returns the error function integrated between the lower and upper bound arguments.

Excel Function:
ERF.PRECISE(limit)

param: float $limit bound for integrating ERF
return: float|string

erfcVal($x)   X-Ref
No description

ERFC($x)   X-Ref
ERFC.

Returns the complementary ERF function integrated between x and infinity

Note: In Excel 2007 or earlier, if you input a negative value for the lower bound argument,
the function would return a #NUM! error. However, in Excel 2010, the function algorithm was
improved, so that it can now calculate the function for both positive and negative x values.
PhpSpreadsheet follows Excel 2010 behaviour, and accepts nagative arguments.

Excel Function:
ERFC(x)

param: float $x The lower bound for integrating ERFC
return: float|string

getConversionGroups()   X-Ref
getConversionGroups
Returns a list of the different conversion groups for UOM conversions.

return: array

getConversionGroupUnits($group = null)   X-Ref
getConversionGroupUnits
Returns an array of units of measure, for a specified conversion group, or for all groups.

param: string $group The group whose units of measure you want to retrieve
return: array

getConversionGroupUnitDetails($group = null)   X-Ref
getConversionGroupUnitDetails.

param: string $group The group whose units of measure you want to retrieve
return: array

getConversionMultipliers()   X-Ref
getConversionMultipliers
Returns an array of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM().

return: array of mixed

CONVERTUOM($value, $fromUOM, $toUOM)   X-Ref
CONVERTUOM.

Converts a number from one measurement system to another.
For example, CONVERT can translate a table of distances in miles to a table of distances
in kilometers.

Excel Function:
CONVERT(value,fromUOM,toUOM)

param: float $value the value in fromUOM to convert
param: string $fromUOM the units for value
param: string $toUOM the units for the result
return: float|string