Download the PHP package ffmg/myoddweb.bignumber.php without Composer

On this page you can find all versions of the php package ffmg/myoddweb.bignumber.php. 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 myoddweb.bignumber.php

myoddweb.bignumber.php

A php bignumber class that does not have any external dependency. Based on the myoddweb.bignumber.cpp project

Status

Build Status Latest Stable Version GitHub license

Usage

In your project

Composer

You can install this library using Composer.

{
    "require": {
        "ffmg/myoddweb.bignumber.php": "0.1.*"
    }
}

And then simply include "require_once "vendor/autoload.php"" in your script, (or whatever path you use to composer).

You can also browse the package directly.

Direct download

Simply include the file "path/to/code/BigNumber.php" in your project.
The other files are just testing and this project.

// in your script
include "path/to/code/BigNumber.php"

// use it
$lhs = new \MyOddWeb\BigNumber( 10 );
$lhs = new \MyOddWeb\BigNumber( 10 );
$sum = $lhs->Add( $rhs );   // = 20

// good times...

Examples

// without composer 
include "path/to/code/BigNumber.php"

// with composer
include "MyOddweb\BigNumber\BigNumber.php"

Simple usage:

See the various tests for more sample code.

Big numbers using strings

// using strings
$x = new \MyOddWeb\BigNumber("18446744073709551615");
$y = new \MyOddWeb\BigNumber("348446744073709551615");
$sum = $x->Add( $y )->ToString();

Integers

// using int
$x = new \MyOddWeb\BigNumber(17);
$y = new \MyOddWeb\BigNumber(26);
$sum = $x->Add( $y )->ToInt();

Doubles

// using doubles
$x = new \MyOddWeb\BigNumber(17.0);
$y = new \MyOddWeb\BigNumber(26.0);
$sum = $x->Add( $y )->ToDouble();

Convert to another base

// output number to base 2.
$x = new \MyOddWeb\BigNumber(5);
$base2 = $x->ToBase( 2 );   // =101 (base 2)

// fraction/real numbers
// output number to base 8 with decimals.
$x = new \MyOddWeb\BigNumber(10.8);
$base2 = x->ToBase( 8, 2 ); // =12.63 (base 8)

You can convert from base 2 to base 62

Operations in one line:

Integers

$x = new \MyOddWeb\BigNumber("17")->Add(\MyOddWeb\BigNumber("26"))->ToInt();

Double

$x = new \MyOddWeb\BigNumber(1.234)->Add(\MyOddWeb\BigNumber(2.345))->ToDouble();

Create a single item inline

$x = (new \MyOddWeb\BigNumber( 123 ) )->Log( 20 )->Sub(12)

or you could do the same without the 'new' argument.

$x = \MyOddWeb\BigNumber( 123 )->Log( 20 )->Sub(12)

Functions

Math functions

Other functions

Constants

Todo

see the myoddweb.bignumber.cpp project as functions are added here after they are added to the cpp project.


All versions of myoddweb.bignumber.php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
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 ffmg/myoddweb.bignumber.php contains the following files

Loading the files please wait ....