2017 © Pedro Peláez
 

library math

Math calculation, number representation package

image

enimiste/math

Math calculation, number representation package

  • Monday, January 23, 2017
  • by nouni.elbachir
  • Repository
  • 1 Watchers
  • 0 Stars
  • 84 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

Financial number manipulation in PHP

The aim of this package is to facilitate the manipulation and calculs on float numbers without errors., (*1)

Class Number

This is an abstract class for all math numbers. This class preserve the original value from what the number is created. Numbers can be compared : lt, le, ge, ge, equals to other numbers (implementing Number class) or PHP Scalar numbers., (*2)

Class IntegerNumber

Represents an integer number. You can create new integers from strings, float and pure integer values. NB: conversion from float to integer is used with round : - 1.2 ==> 1 - 1.5 ==> 1 - 1.6 ==> 2, (*3)

Examples

$ints[] = new Enimiste\Math\VO\IntegerNumber(1);

$ints[] = new Enimiste\Math\VO\IntegerNumber(1.0);

$ints[] = new Enimiste\Math\VO\IntegerNumber('1');

$ints[] = new Enimiste\Math\VO\IntegerNumber(1.39);

$ints[] = new Enimiste\Math\VO\IntegerNumber(1.7);

$ints[] = new Enimiste\Math\VO\IntegerNumber(-3);

The code below :, (*4)

foreach($ints as $x) { 
    echo $x->getValue(); 
    echo $x->getOrigin(); 
    echo $x->__toString(); 
}

will output the results : - 1 | 1 | "1" - 1 | 1.0 | "1" - 1 | "1" | "1" - 1 | 1.39 | "1" - 2 | 1.7 | "2" - -3 | -3 | "-3", (*5)

The Versions

23/01 2017

dev-master

9999999-dev

Math calculation, number representation package

  Sources   Download

MIT

The Requires

  • ext-bcmath *
  • php >=5.5

 

The Development Requires

by El bachir NOUNI

laravel math number tva float price financial

23/01 2017

v1.0.1

1.0.1.0

Math calculation, number representation package

  Sources   Download

MIT

The Requires

  • php >=5.5
  • ext-bcmath *

 

The Development Requires

by El bachir NOUNI

laravel math number tva float price financial

21/07 2016

v1.0.0

1.0.0.0

Math calculation, number representation package

  Sources   Download

MIT

The Requires

  • php >=5.6
  • ext-bcmath *

 

The Development Requires

by El bachir NOUNI

laravel math number tva float price financial