GithubHelp home page GithubHelp logo

bigfib's Introduction

bigfib: Partial bignum package with demo apps

This software implements "big" unsigned integers. These integers use an array of "buckets" holding pieces of an integer, so that the integer can contain an arbitrary number of bits. (This is a standard technique: see for example libgmp for a full-featured fancy implementation.)

bigint

The bigint code is in bigint.h and bigint.c. The only operations currently implemented are conversion from hexadecimal strings, printing as a hexidecimal string, and addition.

bigadd

The demo app bigadd takes two hexadecimal integers of arbitrary length as arguments and prints the sum of these integers in hexadecimal on standard output. For example:

$ ./bigadd 123456789abcdef 23456789abcde0
1468acf13579bcf

A Python 3 version of this app is available in bigadd.py for testing and comparison purposes.

$ python3 bigadd.py 123456789abcdef 23456789abcde0
1468acf13579bcf

bigfib

The demo app bigfib takes a positive decimal argument n on the command line and prints the n-th Fibonacci Number in hexadecimal on standard output. The code follows the convention documented in the link above:

F[1] = 1
F[2] = 1
F[3] = 2
F[4] = 3
F[5] = 5
…

For example:

$ ./bigfib 200
338864a5c1caeb07d0ef067cb83df17e395

A Python 3 version of this app is available in bigfib.py for testing and comparison purposes.

$ python3 bigfib.py 200
338864a5c1caeb07d0ef067cb83df17e395

unit

There is a unit test app. It currently only tests the ADDC primitive used in bignum_add.

PSU CS 201 HW 4

Please see README-HW4.md for the homework assignment related to this code.

License

This code is available under the "MIT License". Please see the file LICENSE in this distribution for license terms.

bigfib's People

Contributors

bartmassey avatar

Watchers

 avatar  avatar  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.