Coder Social home page Coder Social logo

cpsusie / cjm-numerics Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 21.09 MB

CJM Numerics (uint128) A header-only library for C++ 20 that provides an unsigned 128-bit integer.

License: MIT License

CMake 0.26% C++ 98.15% Shell 0.72% C# 0.87%
unsigned-integers extended-precision 128-bit cpp20-library constexpr user-defined-literals cross-platform header-only

cjm-numerics's People

Contributors

cpsusie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cpp20nexus

cjm-numerics's Issues

Remove dead code / organize / document

INCLUDED IN THIS: make actual library header-only and without dependencies except c++ std.

Test application will not be header-only and will have dependencies other than c++ std.

Add support for calculation modes

Use built-in 128 bit math where not constant evaluated and available, use compiler intrinsic / asm where x64 windows and not constant evaluated.

Make library header-only.

Library should work on a header-only basis with no dependencies other than the standard libary. Unit test application will have dependencies and depend on boost, abseil[cxx17], date, (double check for additional).

Resolve problem with constexpr evaluation of literals

Ideally, literals should always be evaluated at compile time and emit a compiler error if ill formed (such as too long or unsupported format, like octal). The current code throws an exception if the literal is ill-formed, causing processing of the literal to be deferred to runtime. This behavior is highly undesirable: an exception at runtime for a value known to be invalid at compile-time is unacceptable.

As a work around, which works on msvc, is to store the result of the literal operator in a constexpr local value before returning it. Then, if an error happens, msvc emits an error that it did not result in constant expression. Unfortunately, in GCC, Clang and Intel-LLVM, this strategy causes the error for any (or many) literals. The mere possibility of an exception should not cause this problem, but it seems to.

Since full and proper consteval support does not seem likely on all compilers any time soon, I will attempt to write an exception free early detection mechanism

Improve unit tests

Add help flag. Add ability to specify which tests run. Change default log std::out to file. Maybe add threading / multiple tests @ a time if not too complicated.

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.