Coder Social home page Coder Social logo

biginteger-for-eosio's Introduction

BigInteger for EOS.IO

BigInteger library for EOS Smart Contract

Table of contents

You can use this library in a EOS Smart contract to do arithmetic without any precision limit.

This library has been tested on EOS.IO DAWN 2.x . See EOSIO github.

Original author

Matt McCutchen ( C++ Big Integer Library )

Example


 #include "eoslib/print.hpp"  
 #include "BigIntegerLibrary.hpp"  
    
 BigInteger a = 65536;  
 print("a * a * a * a * a * a * a * a: ", ( a * a * a * a * a * a * a * a ) );  

then, eosd prints 340282366920938463463374607431768211456.

Operators


arithmetic : +, -, *, /, %, ++(pre, post), --(pre, post), +=, -=, *=, /=, %=, etc.. ( see header for more details )
bit : &, |, ^, <<=, >>= , etc.. ( see header for more details ) 

Build

eoscpp -o <wastOutput.wast> <yourContractSrc.cpp> eos_mem_wrapper.cpp BigInteger.cpp BigIntegerAlgorithms.cpp BigIntegerUtils.cpp BigUnsigned.cpp BigUnsignedInABase.cpp

If linker complains about memory_heap variable, then change as followings:

find memory_heap variable in memory.hpp ( eoslib )
then, change :


static memory_manager memory_heap;

biginteger-for-eosio's People

Contributors

swapnibble avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.