Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #82787

Re: 1.0 / 0.0

Path csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c++
Subject Re: 1.0 / 0.0
Date Sun, 16 Jan 2022 12:40:40 -0800
Organization A noiseless patient Spider
Lines 17
Message-ID <86h7a3tnw7.fsf@linuxsc.com> (permalink)
References <sqib7m$sth$1@dont-email.me> <sqkrcr$1n51$1@gioia.aioe.org> <d2927e23-ce48-44dc-abb9-3b77b784bae2n@googlegroups.com> <sqkvnt$1t7e$1@gioia.aioe.org> <sqmlqt$1vhs$1@gioia.aioe.org> <sqnf01$1hn9$1@gioia.aioe.org> <squ4m0$258$1@gioia.aioe.org> <squb43$2oi$1@redfloyd.dont-email.me> <sqvsgu$t98$1@gioia.aioe.org> <sr10qc$mae$2@gioia.aioe.org>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info reader02.eternal-september.org; posting-host="66ee21d996f56235c8cdb5e1ea47e716"; logging-data="1917"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kpX+kuiL4+XexxltU5zxaAsp2qQ88k2c="
User-Agent Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock sha1:sqq5ZFf4tRI7jrMJYqhhYHorpk0= sha1:0OIgyinI0S3/cZ/X99MVgPI1hIY=
Xref csiph.com comp.lang.c++:82787

Show key headers only | View raw


Juha Nieminen <nospam@thanks.invalid> writes:

> Manfred <noname@add.invalid> wrote:
>
>> The irony is that this is probably one of those examples where C beats
>> C++ - good ol' HUGE_VALF or INFINITE would raise no question at all!
>
> What is the type of INFINITE?  What if you want it as one of the other two
> floating point types?  (Is casting defined in this case?)

I haven't checked the C++ standard, but in C (assuming a suitable
infinite value is available) the macro INFINITY expands to a
constant expression of type float, with an infinite value.  Any
value of type float must have corresponding values in type double
and long double, and converting a float value to double or long
double must produce the corresponding value in the target type.
(Converting includes but is not limited to cast operations.)

Back to comp.lang.c++ | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

1.0 / 0.0 Bonita Montero <Bonita.Montero@gmail.com> - 2021-12-29 20:00 +0100
  Re: 1.0 / 0.0 Jack Lemmon <invalid@invalid.net> - 2021-12-29 19:15 +0000
    Re: 1.0 / 0.0 Bonita Montero <Bonita.Montero@gmail.com> - 2021-12-29 21:20 +0100
  Re: 1.0 / 0.0 "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2021-12-29 13:08 -0800
    Re: 1.0 / 0.0 "daniel...@gmail.com" <danielaparker@gmail.com> - 2021-12-29 20:37 -0800
  Re: 1.0 / 0.0 Paavo Helde <eesnimi@osa.pri.ee> - 2021-12-30 17:25 +0200
    Re: 1.0 / 0.0 "daniel...@gmail.com" <danielaparker@gmail.com> - 2021-12-30 08:55 -0800
  Re: 1.0 / 0.0 Manfred <noname@add.invalid> - 2021-12-30 18:48 +0100
    Re: 1.0 / 0.0 "daniel...@gmail.com" <danielaparker@gmail.com> - 2021-12-30 10:16 -0800
      Re: 1.0 / 0.0 Manfred <noname@add.invalid> - 2021-12-30 20:02 +0100
        Re: 1.0 / 0.0 Muttley@dastardlyhq.com - 2021-12-31 10:25 +0000
          Re: 1.0 / 0.0 Manfred <noname@add.invalid> - 2021-12-31 18:34 +0100
            Re: 1.0 / 0.0 Juha Nieminen <nospam@thanks.invalid> - 2022-01-03 06:21 +0000
              Re: 1.0 / 0.0 red floyd <no.spam.here@its.invalid> - 2022-01-03 00:11 -0800
                Re: 1.0 / 0.0 "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-01-03 09:28 +0100
                Re: 1.0 / 0.0 Juha Nieminen <nospam@thanks.invalid> - 2022-01-03 08:36 +0000
                Re: 1.0 / 0.0 Muttley@dastardlyhq.com - 2022-01-03 09:24 +0000
                Re: 1.0 / 0.0 David Brown <david.brown@hesbynett.no> - 2022-01-03 17:14 +0100
                Re: 1.0 / 0.0 Muttley@dastardlyhq.com - 2022-01-03 16:22 +0000
                Re: 1.0 / 0.0 scott@slp53.sl.home (Scott Lurndal) - 2022-01-03 17:40 +0000
                Re: 1.0 / 0.0 Muttley@dastardlyhq.com - 2022-01-04 09:15 +0000
                Re: 1.0 / 0.0 scott@slp53.sl.home (Scott Lurndal) - 2022-01-04 15:24 +0000
                Re: 1.0 / 0.0 Muttley@dastardlyhq.com - 2022-01-04 16:06 +0000
                Re: 1.0 / 0.0 Juha Nieminen <nospam@thanks.invalid> - 2022-01-04 07:58 +0000
                Re: 1.0 / 0.0 Muttley@dastardlyhq.com - 2022-01-04 09:17 +0000
                Re: 1.0 / 0.0 Manfred <noname@add.invalid> - 2022-01-03 23:14 +0100
                Re: 1.0 / 0.0 Öö Tiib <ootiib@hot.ee> - 2022-01-03 23:50 -0800
                Re: 1.0 / 0.0 Manfred <noname@add.invalid> - 2022-01-04 10:42 +0100
                Re: 1.0 / 0.0 Öö Tiib <ootiib@hot.ee> - 2022-01-04 10:15 -0800
                Re: 1.0 / 0.0 Manfred <noname@invalid.add> - 2022-01-04 20:49 +0100
                Re: 1.0 / 0.0 Öö Tiib <ootiib@hot.ee> - 2022-01-04 15:40 -0800
                Re: 1.0 / 0.0 Juha Nieminen <nospam@thanks.invalid> - 2022-01-04 08:34 +0000
                Re: 1.0 / 0.0 Manfred <noname@add.invalid> - 2022-01-04 10:47 +0100
                Re: 1.0 / 0.0 Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-01-16 12:40 -0800

csiph-web