Download the PHP package sixteenstudio/mathematician without Composer

On this page you can find all versions of the php package sixteenstudio/mathematician. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mathematician

Mathematician

A layer on top of BCMath that deals with fractional calculations

Requirements

The BCMath PHP extension needs to be required in order for this to work.

This package has been developed for PHP 7.0^

Usage

Instead of using standard BCMath functions such as bcadd and bcsub, use the math_ functions provided within the package.

math_add($leftOperand, $rightOperand, $scale): Sixteenstudio\Mathematician\Number

math_sub($leftOperand, $rightOperand, $scale): Sixteenstudio\Mathematician\Number

math_mul($leftOperand, $rightOperand, $scale): Sixteenstudio\Mathematician\Number

math_div($leftOperand, $rightOperand, $scale): Sixteenstudio\Mathematician\Number

These functions return an instance of Sixteenstudio\Mathematician\Number, unlike BCMath which returns a string representation of the decimal result of the calculation.

This allows us to do some neat things like represent certain operations as fractions, which in turn allows us to do things like this far more accurately than the likes of standard float logic or BCMath can handle:

(1 / 3) * 3 // Equates to 0.9999999999813

bcmul(bcdiv(1, 3, 20), 3, 20) // Equates to 0.99999999999999999997

math_mul(math_div(1, 3, 20), 3, 20) // Equates to 1.00000000000000000000

If you'd prefer not to use the helpers, you can insantiate the Sixteenstudio\Mathematician\Mathematician class and use the respective functions directly like so:


All versions of mathematician with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sixteenstudio/mathematician contains the following files

Loading the files please wait ....