It's copyrighted so I should not even look at it, and therefore not comment on it.
Show HN: Floating point arithmetic types in C++ for any size and any base
31–40 of 42 posts
Re: Show HN: Floating point arithmetic types in C++ for any size and any base
#32Re: Show HN: Floating point arithmetic types in C++ for any size and any base
#33Isn't this in libgmp already? https://gmplib.org/
Re: Show HN: Floating point arithmetic types in C++ for any size and any base
#34Re: Show HN: Floating point arithmetic types in C++ for any size and any base
#35Surely you mean ::max()?
> is_fundamental::value et al.
Besides the undefined behavior issue mentioned by others, none of these are syntactially correct.
> #include "fas/stream.hpp>
Ok then...
> The Stl's std::numeric_limits is required the limits of the specified types for mantissa and exponent.
Missing a word? Also, the STL [0] does not have std::numeric_limits, perhaps you mean the C++ standard library (or stdlib for short).
Re: Show HN: Floating point arithmetic types in C++ for any size and any base
#36No LICENSE. Have you thought about adding one?
Somebody wants to use it? :D I thought about something like where people can use it but have to make changed public. I am just curious, what should be changed. But I dont think there is actually a real world use case.
Re: Show HN: Floating point arithmetic types in C++ for any size and any base
#37Re: Show HN: Floating point arithmetic types in C++ for any size and any base
#38Earlier quoted context omitted.
GMP doesn't do arbitrary exponents.
Indeed, thanks.
However, this is not exposed in all GMP wrappers.
Re: Show HN: Floating point arithmetic types in C++ for any size and any base
#39It's copyrighted so I should not even look at it, and therefore not comment on it.
Removed it.
If you really don’t want the copyrights, you can use the CC0 license from Creative Commons. That would allow people to use your code any way they want with no restrictions (which means they are legally allowed to use it commercially, remove the author notice, re-license modified versions, redistribute the code, etc.). However, you do not need to waive your copyrights entirely in order to license your code as open source. You can choose between a variety of licensing terms, while still being very open and liberal about sharing. Try the Creative Commons license chooser https://chooser-beta.creativecommons.org/. Or look through open source licenses. Standardized SPDX IDs are gaining popularity since it helps with some automation workflows. https://opensource.org/licenses https://spdx.org/licenses/
Since you left the author note, maybe you would like an attribution license like one of these popular choices (both available with SPDX IDs): https://opensource.org/license/bsd-3-clause https://creativecommons.org/licenses/by-sa/4.0/
If you don’t add a license, then your code remains under strict copyright and people are not legally allowed to use it in their own projects, regardless of whether you have a copyright notice in the comments. Leaving out the copyright notice might be confusing, especially given this thread. The recommended practice is to include both the copyright notice and the license in comments or a license file.
Re: Show HN: Floating point arithmetic types in C++ for any size and any base
#40Earlier quoted context omitted.
Indeed, thanks.
Slight correction, while the exponent is indeed fixed, it is larger than a f32/f64 exponent: https://gmplib.org/manual/Floating_002dpoint-Functions However, this is not exposed in all GMP wrappers.
In fas you have to specify the sizes (of mantissa and exponent) during compile time. So the size of this type is fixed. Thus, there is no heap involved.