Giter VIP home page Giter VIP logo

bignumber's Introduction

本文档是大数运算程序说明书 本文档包括以下内容: 1)数据存储方式 2)数据表示方式 3)函数设计规范 4)技术限制 5) 实现功能 6)参考

1) >数据一律以C语言ANSI标准的char数组存储

2) > 数据以字符串形式表示,以'\n'作为结束标志,否则认定错误 > 数据合法字符只包括12个,即:0,1,2,3,4,5,6,7,8,9,+,- > +,-两个符号表示数据的正负,可有可无,但有则必须放在字符串最左 > 字符串表示的数字可以以有限个0占据最高位 > 字符串最长为 1024102432,即32M > 示例1: 1234567890 > 示例2: +123456789 > 示例3: -123456789 > 示例4: 0000000123 > 示例5: +000000123

3) > 函数名 BN_functionName_type > 一律返回int型整数,0表示正确,其他表示错误 > 不能改变输入操作数 > 运算结果存放于函数内部动态申请的缓冲区中,由外部调用着负责释放

4) > 为保证程序可移植性,务必只使用标准C库函数

  1. 两大数相加 两大数相减 两大数相乘 两大数相除,返回商和余数

6) > BN_MAX_SIZE 允许最长数字串 > BN_SUCCESS 函数成功 > BN_ILLEGAL_CHARACTOR 非法字符 > BN_ILLEGAL_END 数字串不以'\n'结束 > BN_INPUT_EMPTY 输入数字串为空 > BN_OUTOF_SIZE 数字串长度超过了MAX_SIZE > BN_PARAM_INVALID 无效参数 > BN_ZERO_DIVER 除数为0 > BN_NO_MEMERY 申请内存失败

gcc -g main.c bigNumber.c bigNumber.h common_file.h -o bigNumber

bignumber's People

Watchers

James Cloos avatar musenwill 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.