3 ms·
Here's a C/C++ partial implementation of posits: https://github.com/libcg/bfp https://github.com/libcg/bfp
by copperx 9y ago
Here's a C/C++ partial implementation of posits:
https://github.com/libcg/bfp https://github.com/libcg/bfp
- akkartik 9y agoThanks! Can you elaborate on what's missing?
- libcg 9y agoConversion from/to float and double, multiplication, division and reciprocation are implemented and should be working properly. The next big TODOs are addition, substraction and rounding. Then advanced operations like sqrt, fma, etc. As part of the posit spec. I've been working alone on that project, this being my first time working with floating point representation. I'm happy I could even get to that stage, and I hope someone can pick up my work and start contributing.
- dnautics 9y agobfp uses C++ classes which store the format hyperparameters as fields. If you'd rather a C/C++ library memory layout which reflects the bitwidth of the particular posit: https://github.com/Etaphase/FastSigmoids.jl https://github.com/Etaphase/FastSigmoids.jl contains both a julia library and a C/C++ library. Posits are implemented as a C type and a C++ class where the type and class sizes correspond to the bitwidth.
- libcg 9y agoDev here, I'm planning to transition to a C library with fixed size posit implementations. I need all the help I can get :) FastSigmoids uses float and double types which would be problematic in embedded environments.
- dnautics 9y agoShoot me a message. I am planning on making a bitwise/intmath implementation in C. Things might be accelerated if you know someone interested in sponsoring it.