GithubHelp home page GithubHelp logo

johnmcfarlane / fixed_point Goto Github PK

View Code? Open in Web Editor NEW
228.0 228.0 37.0 2.99 MB

C++ Binary Fixed-Point Arithmetic

Home Page: http://johnmcfarlane.github.io/fixed_point/

License: Boost Software License 1.0

CMake 2.03% C++ 97.02% Shell 0.06% Python 0.89% C 0.01%
benchmark boost c-plus-plus clang cmake fixed-point gcc

fixed_point's People

Contributors

hbe72 avatar johnmcfarlane avatar sethml avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fixed_point's Issues

Investigate why tests aren't failing on MSVC

Multiplication between 64-bit numbers should overflow and/or cause compiler errors on platforms with no 128-bit integers and MSVC++ doesn't have 128-bit integers. But tests pass. Make sure tests are robust enough.

Mention that '"Exponent" will typically be negative'

Suggestion via Paul Robinson:

"Exponent" will typically be negative
The proposal doesn't discuss this but the typical use-case of a value
with both integer and fractional digits would require Exponent to be
negative. For example make_ufixed<4, 4> would have to be the same type
as fixed_point<uint8_t, -4> (in order for the stated maximum/minimum
values to work out correctly). This is perfectly fine, but when it
comes to working out the wording in the standard, this would definitely
be worthy of an example or footnote.

improve README.md

Move installation instructions to README.md
Clearer link
link in other direction
Better blurb/highlights in index.md and README.md
Include notes about cmark, Doxygen and boost
Links to source in index.mf

Write simple resize helper

Such that built-in integer resize can be defined as:

template <typename UnsignedInteger>
struct resize 
    : resize_family
    <
        UnsignedInteger, uint8_t, uint16_t, uint32_t, uint64_t, unsigned __128int_t
    > {};

template <typename SignedInteger>
struct resize 
    : resize_family
    <
        SignedInteger, int8_t, int16_t, int32_t, int64_t, signed __128int_t
    > {};

License

There is no licensing information provided, could this please be clarified? Thank you.

Add explanation to p0037

To answer the Jacksonville questions:

  • How does resize work with user-supplied representations? and
  • The specialization of numeric limits is good. We wonder how it might apply to unbounded types.

fixed_point overused

Use the phrase fixed-point more often in line with floating-point and integer/integral.

Convert code blocks

This style

template <typename N>
struct S;

is not as colorful as

template <typename N>
struct S;

replace `resize`

cpp_int proves that sizeof and resize are not complements of one another. What about set_width? It takes bits, not bytes. Parameter can be unsigned - for now at least.

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.