p-hatan/ mirror

pub repository

mirror.p-hatan.ir

bignum

0.0.1

Big Number library for Dart

Download archive

Readme

dart-bignum

BigInteger is under construction.

Getting Started

Create a Dart project and add a pubspec.yaml file to it

dependencies:
  dart-bignum:
    git: git://github.com/Solvr/dart-bignum.git

and run pub install to install dart-bignum (including its dependencies). Now add import

#import('package:bignum/bignum.dart');

Example

#import('package:bignum/bignum.dart');
void main() {
  BigInteger x = new BigInteger("12341234123412341234");
  BigInteger y = new BigInteger("100");
  var z = x * y * x;
  print("base 10: z = ${z.toString()}");
  print("base 16: z = ${z.toString(16)}");
  print("base 2: z = ${z.toString(2)}");
}
base 10: z = 15230605968887717854389148085725664275600
base 16: z = 2cc23c02bae6a6051a5ce673189c3a6c90
base 2: z = 10110011000010001111000000001010111010111001101010011000000101000110100101110011100110011100110001100010011100001110100110110010010000

Sample

live. The sample currently has known issues with bitwise operators.

Documentation

dartdoc generated documentation can be found here solvr:bignum

Caveats

Currently few known bugs exist while compiling from dart2js. One is working with bitwise operators, the internal implementation of shift operators with dart2js does not handle the same way as the VM. Most of this code was ported from v8 benchmark suite. Tom Wu is to thank for the core javascript implementation and the v8 team for optimizations on different javascript virtual machines.

Bugs & Testing

Please feel free to add issues on github issue tracker, we would like to provide a solid library for the community to use.

References

Changelog

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add bignum
pubspec.yaml
name: bignum
description: Big Number library for Dart
version: 0.0.1
author: Adam Singer <adam@solvr.io>
homepage: https://github.com/Solvr/dart-bignum
dependencies:
  unittest:
    sdk: unittest

Version history

VersionPublishedArchiveSHA-256
0.0.12012-09-25T18:31:22.306940ZDownloadb013670422e6a3660bc4ae249b0ccd5ce37d5f28b44de658ac50c21f9679176f
0.0.32013-04-27T01:11:52.103490ZDownloadaea58b6453aac2ec612be5686984e7e7ec09ee714f0c6a67cd7719526cf5696e
0.0.42014-01-14T06:51:58.038390ZDownload80ff20fc082beb390005439bff482cc7a7e81e07dd180f263504034e27e91951
0.0.52014-02-19T04:37:26.015060ZDownloadc746320d0dbb79ffa1604357c96dfb20c5beec9fbf83b63ca15235fbae766acd
0.0.62014-09-03T05:05:29.713370ZDownload4c1c1ac3926d4a7b7f0703d3029c8f6a96ef4a5a17cf0a78744235d43c0a3447
0.0.72015-06-30T04:36:28.872ZDownload734bdd6e6096f5b5b5a38f2335d2e28336e1f25f60505dcda38d6709ecbbcec6
0.1.02016-02-03T22:25:04.064ZDownloadc11d1322b98ee021b1293c29b45e0f92181a70f600dfeff1de2556c072918baf

Dependencies

unittest { "sdk": "unittest" }