ufcpp / bitfields Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
There are mixed new lines in generated source codes.
public DoubleView(Bit52 faction, Bit11 exponent, Bit1 Sign)
{
Value = 0;
Value |= (fraction & FractionMask) << FractionShift)
Value |= (fraction & ExponentMask) << ExponentShift)
Value |= (fraction & SignMask) << SignShift)
}
This works correctly:
Bit3 b3 = 99;
I got the expected error: "Constant value '99' cannot be converted to a 'Bit3'"
but this passes:
Bit3 b3 = 98 + 1;
Admittedly is strange to use the '+' on a Bit... I don't if is possible to catch this error too or not...
Exception thrown when attempting to generate bit-fields without any enum members
To make BitX more as number Value should not be public but private / internal, any conversion should happen with cast operations.
Using the "usual" sample code:
struct DoubleView
{
enum BitFields
{
Fraction = 11,
Exponent = 52,
Sign = 1,
}
}
In the light bulb is only suggested to move the type in a new file nothing else!
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.