Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Many alligators will be slain, but the swamp will remain.


devel / comp.lang.c / Re: contradiction about the INFINITY macro

SubjectAuthor
o Re: contradiction about the INFINITY macroJames Kuyper

1
Re: contradiction about the INFINITY macro

<sk1p83$5e3$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18646&group=comp.lang.c++#18646

  copy link   Newsgroups: comp.lang.c
 by: James Kuyper - Mon, 11 Oct 2021 16:37 UTC

On 10/9/21 4:17 PM, Vincent Lefevre wrote:
> In article <86wnmoov7c.fsf@linuxsc.com>,
> Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
>
>> What occurs is defined behavior and (for implementations that do
>> not have the needed value for infinity) violates a constraint.
>> A diagnostic must be produced.
>
> If this is defined behavior, where is the result of an overflow
> defined by the standard? (I can see only 7.12.1p5, but this is
> for math functions; here, this is a constant that overflows.)

"For decimal floating constants, and also for hexadecimal floating
constants when FLT_RADIX is not a power of 2, the result is either
the nearest representable value, or the larger or smaller representable
value immediately adjacent to the nearest representable value, chosen in
an implementation-defined manner.
For hexadecimal floating constants when FLT_RADIX is a power of 2, the
result is correctly rounded." (6.4.4.2p3)

In the case of overflow, for a type that cannot represent infinity,
there is only one "nearest representable value", which is DBL_MAX.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor