Coder Social home page Coder Social logo

math.h's Introduction

Summary of the math.h Project

The math.h project focuses on recreating the standard math.h library in the C programming language. This initiative has been designed to give developers a comprehensive understanding of computational methods while reinforcing the principles of structured programming.

Installation

git clone https://github.com/0xmisha/math.h.git
cd math.h/src
make

Requirements

  • Gcc
  • Make
  • check.h (for tests)

Info

Here's a quick rundown of what was achieved:

  • Reimplementation of math.h Functions: The project successfully reimplemented the following functions from the math.h library:

    • abs
    • acos
    • asin
    • atan
    • ceil
    • cos
    • exp
    • fabs
    • floor
    • fmod
    • log
    • pow
    • sin
    • sqrt
    • tan
  • C11 Standard Compliance: All coding was done following the C11 standard using the gcc compiler.

  • Code Structuring: Adherence to the Google coding style was maintained, and the project was structured as a static library. All source codes were organized in the src folder within the develop branch.

  • Legacy Code Avoidance: Outdated and obsolete language constructs were deliberately avoided, and the POSIX.1-2017 standard was adhered to.

  • Prefixing: Each function was prefixed with s21_ to maintain clarity and uniqueness.

  • Unit Testing: A rigorous testing regime was set up using the Check library. The tests compared the results from the s21_math library with the standard math.h library to ensure accuracy.

  • Coverage: Tests covered at least 80% of each function's code, as verified with gcov.

  • Build Automation: A Makefile was provided to simplify the building process. It included targets like all, clean, test, s21_math.a, and gcov_report.

  • gcov Reporting: The gcov report was made accessible in an HTML format to ensure transparency.

  • Accuracy: A stringent accuracy threshold was maintained, with 16 significant digits for the total verifiable accuracy and up to 6 decimal places for the fractional part.

math.h's People

Contributors

0xmisha 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.