Giter Club home page Giter Club logo

bignumberbaseconverterc's Introduction

BigNumberBaseConverter C

A Super-Fast C-Program for converting very huge/big numbers from one base to another base without Limitation.

Features

  • Super-Fast - It's written in C, so it's super-fast.
  • No Limitation - It can convert very huge/big numbers from one base to another base without any limitation.
  • Easy to Use - It's very easy to use.
  • Cross-Platform - It's cross-platform, so it can be used on any platform.
  • Open-Source - It's open-source, so you can use it for free.

Functions

  • int convertCharToInt(char c): Function to convert a character to its digit representation
  • char convertIntToChar(int n): Function to convert a digit to its character representation
  • BigNumber* BigNumberCreate(int capacity): Function to create a new empty BigNumber with a given capacity
  • BigNumber* stringToBigNumber(char *string): Function to create a new BigNumber from a string
  • BigNumber* intToBigNumber(int number): Function to create a new BigNumber from a int
  • void BigNumberAppendBegin(BigNumber *number, int digit): Function to add a new digit at the beginning of a BigNumber
  • void BigNumberAppendEnd(BigNumber *number, int digit): Function to add a new digit at the end of a big number
  • int BigNumberGet(BigNumber *number, int index): Function to get the digit at a given index of a BigNumber
  • int BigNumberGetNumber(BigNumber *number): Function to get the int representation of a BigNumber
  • void BigNumberFree(BigNumber *number): Function to free the memory occupied by a big number
  • void BigNumberPrintString(BigNumber *number): Function to print a BigNumber in charachter form
  • void BigNumberPrint(BigNumber *number): Function to print a BigNumber
  • BigNumber* copyBigNumber(BigNumber *number): Function to deep copy a BigNumber
  • void stringReverse(char *str): Function to reverse a string
  • char* stringTrim(char* str): Function to remove leading whitespaces of a string
  • char *fileReads(char *filepath): Function to read contents of a file
  • BigNumber* BigNumberMod(BigNumber* number1, int number2): Function to calculate modulu of two large number
  • BigNumber* BigNumberSub(BigNumber* number1, BigNumber* number2): Function to calculate subtraction of two large number
  • BigNumber* BigNumberDiv(BigNumber* number1, int number2): Function to calculate division of two large number
  • int BigNumberCompare(BigNumber* number1, BigNumber* number2): Function to compare two large number
  • BigNumber* convertBase10ToN(BigNumber* number, int n): Function to convert a positive number number to its digit representation in base n.

Using

Convert a number given from user

$ ./BigNumberBaseConverter 10 2 123456789

The above command will convert the number 123456789 from base 10 to base 2 and print the result.

Convert a number from a file and save the result in another file

$ ./BigNumberBaseConverter -f input.txt 10 2 > result.txt

The above command will convert the number from the file filename.txt from base 10 to base 2 and print the result to the file result.txt.

Convert a number from a file and print the result to the console

$ ./BigNumberBaseConverter -f input.txt 10 2

The above command will convert the number from the file filename.txt from base 10 to base 2 and print the result to the console.

© Copyright 2022, Max Base

bignumberbaseconverterc's People

Watchers

 avatar

bignumberbaseconverterc's Issues

Simple base conversion does not work

Assuming the program is compiled to basec.exe:

basec 10 10 16 returns "a" which is correct

However, the reverse calculation seems incorrect:

basec a 16 10 returns "17" which is incorrect

The question is: Can the code actually convert from any base to any other base?

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.