johnmcfarlane / fixed_point Goto Github PK
View Code? Open in Web Editor NEWC++ Binary Fixed-Point Arithmetic
Home Page: http://johnmcfarlane.github.io/fixed_point/
License: Boost Software License 1.0
C++ Binary Fixed-Point Arithmetic
Home Page: http://johnmcfarlane.github.io/fixed_point/
License: Boost Software License 1.0
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.
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.
Convert these functions to C++11 constexpr
type and add to fixed_point_utils.h.
As with the fp library, make multiprecision.h simpler by using the boost::multiprecision::cpp_int (or whatever) types.
don't throw spare bits at fractional_digits!
And repr_type
to rep
in line with chrono.
As mentioned in section Alternative Return Type Policies of P0037R1.
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
> {};
Claims no loss of bits. And hey, why not actually implement those!
On main instruction page, perf stat ./run_benchmarks
should read perf record -g ./run_benchmarks
.
Excluded it when exceptions are off.
There is no licensing information provided, could this please be clarified? Thank you.
Also floating-point literals for elastic equivalent.
"straddle two 'homes"
Link to P0037 broken and title sucks
Use the phrase fixed-point more often in line with floating-point and integer/integral.
E.g. an instruction that multiplies with saturation, then shifts right by 15 digits.
Currently disabled via common.cmake.
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
Very touchy subject, so move e.g. std::make_unsigned<fixed_point<>>
to sg14
namespace.
Casting where all three of signage, integer digits and fractional digits of the destination match or exceed the source should not be explicit.
Mention predictability.
Possibly as named function?
To answer the Jacksonville questions:
move multiply
etc. into sg14 and remove promot and trunc etc.
As suggested by Paul Robinson
"Named arithmetic functions" (promote_*)
Section of P0037
This style
template <typename N>
struct S;
is not as colorful as
template <typename N>
struct S;
Alternative Return Type Policies suggests work that has since been executed upon.
and replace hacky instruction about -fno-omit-frame-pointer
in index.md
In particular:
Remove code surrounded in _GLIBCXX_USE_INT128
from type_traits.h. It can all live in bits/int128.h.
via an alias
Generally, common_type
involving fixed_point
should behave closer to ReprType
.
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.
Follow up on the helpful advice provided by Ryhor.
With elastic type.
but maybe to sub-folder auxiliary and move elastic there too
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.