On 11/10/26 6:42 AM, Sayan Samanta via Boost wrote:
Hi all,
I'm Sayan. I am a computational thermodynamicist. I write C++ software for computing phase equilibrium : given a temperature, pressure and composition, will my liquid vapourise or not - that kinda stuff.
... I would like to suggest that perhaps you might want to think bigger. I am the author of the Boost Safe Numerics library. The library could be summarized by describing it as a library which associates an integer type to a range of valid values specified at compile time. Such integers are "packaged" as a new type - safe_integer - which verifies that any results are with the accepted range and and invokes a user described error handling mechanism. This verification is done at compile time if possible otherwise it's done at runtime. Implementation is specific to integers and uses const expr operations as much as possible. So far so good. But I didn't think big enough. I'm been considering extending the library to include floating point numbers and looked at Boost Interval. The main factor which got my attention is that Boost Interval is not const expr friendly. That is, results which can be verified at compile time are not done so. I didn't investigate to what extent the handling of a detected error could be configured by the user. I could extend Safe Numerics to floating point, but I'd rather just import Boost Interval so that we don't have two implementations of basically the same thing. Call it refactoring. So I would suggest that who ever takes this task on consider the situation. It would be beneficial for both Boost Interval and Boost Safe Numerics if my concerns were addressed. But I haven't been thinking big enough. There is a new library named Boost Decimal which fills a valuable need. If Safe Numerics could be applied to Boost Decimal, the combination would be great value especially those handling financial numerics with large values. I think it would be indispensable in such situations. But still not good enough. I've been pondering making things even more general. Some years ago I gave a talk at CPPCon titled something like "C++ and abstract algebra". It was an interesting idea but it wasn't really complete. I would like to see considered the idea that we make a hierarchy of numeric types organized along the lines of abstract algebra. Of course The Safe Numerics would then depend on Boost Abstrace Algebra. Any other future numeric types would usable by Safe Numerics as long it fulfilled a listed set of type requirements (concepts). To me, this would be the holy grail of provably correct numeric code. Robert Ramey www.rrsd.com (805)569-3793