Friday, December 31, 2021

Digest for comp.lang.c++@googlegroups.com - 2 updates in 1 topic

Muttley@dastardlyhq.com: Dec 31 10:25AM

On Thu, 30 Dec 2021 20:02:21 +0100
>>> HUGE_VALL from <cmath> (aka <math.h>)?
 
>> Why not INFINITY from math.h?
 
>Also possible, yes.
 
Certainly all better than some ugly divide by zero hack.
Manfred <noname@add.invalid>: Dec 31 06:34PM +0100


>>> Why not INFINITY from math.h?
 
>> Also possible, yes.
 
> Certainly all better than some ugly divide by zero hack.
 
And obviously, if you really want it C++ish
 
namespace my
{
static constexpr float inf = std::numeric_limits<float>::infinity();
}
 
/* use my::inf wherever you like */
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: