
On 1/16/25 10:25 AM, Peter Dimov via Boost wrote:
IEEE floating point doesn't have undefined behavior, so it's always "safe" in the "no undefined behavior" sense. (Assuming that floating point exceptions are disabled. When they are enabled, it's not so clear.)
For better or worse, safe numerics goes beyond undefined behavior in trapping behavior which fails to replicate the arithmetical behavior of the underlying type. This is meant to guarantee the we always get a valid arithmetic result or a trap. In any case, knowing that decimal32 et al fulfills the requirements for Numeric<T> should be good enough. If it's not, that's something that should be addressed within safe numerics. In a related note, the interval arithmetic library should also work with decimal32. I don't know how much this library is used or even it's maintained. But I would be curious if it's usable with decimal32. I had looked at the library as the implementation of safe numerics requires this functionality, but I found it unsuitable for non-floating types - ie integer types.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost