Overview

Namespaces

  • BN
    • Collections
    • Compiler
      • Grammar
      • Parser
        • Operator
        • Token
      • Postfix
        • Operands
        • Operator
        • Token
      • Scanner
        • Converter
      • Token
  • Demo
  • None

Classes

  • AggregateFunctions
  • Number
  • NumberFactory
  • OperatorsFactory

Interfaces

  • INumber
  • Overview
  • Namespace
  • Class
  • Tree

Class NumberFactory

Factory for creating @see Number from string, integer, float or object. Useful for creating numbers from different types because Number throws \InvalidArgumentException if argument in constructor is not string. It can also create numbers for mathematical constants pi and e.

Namespace: BN
Located at lib/BN/NumberFactory.php
Methods summary
public
# __construct( )
public BN\INumber
# createNumber( string|integer|float|object $number )

Try to create new @see Number from an argument.

Try to create new @see Number from an argument.

Parameters

$number
string|integer|float|object
$number

Returns

BN\INumber

Throws

InvalidArgumentException
if $number is not numeric string, int, float or object with __toString() method
public BN\Number
# createPI( )

Returns a new number which represents a mathematical constant π (PI). Precision of the constant is 200 digits after decimal point.

Returns a new number which represents a mathematical constant π (PI). Precision of the constant is 200 digits after decimal point.

Returns

BN\Number
public BN\Number
# createEulerNumber( )

Returns a new number which represents a mathematical constant e (Euler's number). Precision of the constant is 200 digits after decimal point.

Returns a new number which represents a mathematical constant e (Euler's number). Precision of the constant is 200 digits after decimal point.

Returns

BN\Number
BN-PHP - Big Number data type for PHP API documentation generated by ApiGen 2.8.0