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


Groups > comp.lang.c > #124306

Re: NULL as the empty string

Path csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: NULL as the empty string
Date Wed, 13 Dec 2017 14:02:32 -0800
Organization None to speak of
Lines 34
Message-ID <ln8te6nv5z.fsf@kst-u.example.com> (permalink)
References <ov2an8$7sq$1@dont-email.me> <lny3mzte7w.fsf@kst-u.example.com> <0f96b837-7b9a-435f-81ec-8bbc8d2f928b@googlegroups.com> <ln7etxt4ox.fsf@kst-u.example.com> <p0etae$tqd$1@dont-email.me> <lnzi6trkxz.fsf@kst-u.example.com> <p0f1eb$sg1$1@dont-email.me> <lnvahgst7s.fsf@kst-u.example.com> <p0f7ki$6t5$1@dont-email.me> <lnr2s4sr4c.fsf@kst-u.example.com> <p0fap8$oin$1@dont-email.me> <ln7etwsmd7.fsf@kst-u.example.com> <p0fuek$65u$1@dont-email.me> <ln374jsmof.fsf@kst-u.example.com> <200dbc56-510f-48ac-b9b4-64cb421934d3@googlegroups.com> <780aa089-aa70-4232-9838-499bae843bf1@googlegroups.com> <d7b422a0-6791-4b1a-98fd-342b9687a3a2@googlegroups.com> <1be1dc23-3a06-440e-b9a5-6a90aba5bd3b@googlegroups.com> <lnh8suo8kl.fsf@kst-u.example.com> <542d2a4c-15fb-4040-a766-4638b66c7ea4@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info reader02.eternal-september.org; posting-host="50e352b03c9870c864aa96ff340b6923"; logging-data="18537"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19wSDnGzPPUkjcqYQ9QXYvH"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:KX6oBxMVShHqkr3Niw0OBIjNCBc= sha1:rNc72LI7Jd9ovmRR0KadCUR1/6k=
Xref csiph.com comp.lang.c:124306

Show key headers only | View raw


Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
> On Wednesday, December 13, 2017 at 5:13:10 PM UTC, Keith Thompson wrote:
>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>> [...]
>> > Assuming that NaN represents missing values, taking the mean makes sense.
>> > Simply ignore those values. Taking the sum is a slippier concept and
>> > you don't want it handled at hardware level or in the language definition.
>> > It belongs in the high-level code written by statistical people, who
>> > may not know much about optimising compilers.
>> 
>> The mean is by definition the sum divided by the count.  *If* the
>> specification calls for NaNs to be ignored, then they should be
>> ignored whether you're computing a sum or a mean.  (If all entries
>> are NaNs, then I suppose the sum would be 0 and the mean would
>> be undefined.)
>> 
> For "sum", it makes more sense to add the mean rather than 0 if NaNs
> represent missing values. 

So the sum of (2, NaN, 4) should be 9?

If that's what the specification calls for fine, but I can't imagine any
reason to assume it.  The whole idea of a NaN is that it propagates
through calculations.  2+NaN+4 should be Nan -- or *maybe* 6 if you
decide to ignore NaNs.

For that matter, the "+" operator computes the some of (a sequence of)
two values.  Should 2+NaN yield 2?

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

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


Thread

NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-21 23:52 +0100
  Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-11-21 15:16 -0800
    Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-22 00:38 +0100
      Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-11-21 16:02 -0800
        Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-22 01:13 +0100
          Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-11-21 16:52 -0800
      Re: NULL as the empty string Robert Wessel <robertwessel2@yahoo.com> - 2017-11-21 18:09 -0600
      Re: NULL as the empty string Siri Cruise <chine.bleu@yahoo.com> - 2017-11-21 16:34 -0800
      Re: NULL as the empty string David Brown <david.brown@hesbynett.no> - 2017-11-22 12:12 +0100
    Re: NULL as the empty string supercat@casperkitty.com - 2017-11-21 15:57 -0800
      Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-22 01:06 +0100
        Re: NULL as the empty string supercat@casperkitty.com - 2017-11-22 15:42 -0800
          Re: NULL as the empty string Melzzzzz <Melzzzzz@zzzzz.com> - 2017-11-22 23:49 +0000
            Re: NULL as the empty string supercat@casperkitty.com - 2017-11-22 15:56 -0800
              Re: NULL as the empty string Melzzzzz <Melzzzzz@zzzzz.com> - 2017-11-23 00:06 +0000
                Re: NULL as the empty string supercat@casperkitty.com - 2017-11-23 17:31 -0800
                Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-24 09:42 +0100
                Re: NULL as the empty string supercat@casperkitty.com - 2017-11-24 13:47 -0800
    Re: NULL as the empty string Jorgen Grahn <grahn+nntp@snipabacken.se> - 2017-11-22 06:46 +0000
    Re: NULL as the empty string John Bode <jfbode1029@gmail.com> - 2017-12-08 10:27 -0800
      Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-08 11:11 -0800
        Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-12-08 21:39 +0100
          Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-08 13:03 -0800
            Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-12-08 22:50 +0100
              Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-08 15:19 -0800
                Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-12-09 00:35 +0100
                Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-08 16:05 -0800
                Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-12-09 01:22 +0100
                Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-08 17:39 -0800
                Re: NULL as the empty string John Bode <jfbode1029@gmail.com> - 2017-12-11 12:22 -0800
                Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-12-09 01:29 +0100
                Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-08 17:47 -0800
                Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-12-09 07:05 +0100
                Re: NULL as the empty string David Brown <david.brown@hesbynett.no> - 2017-12-09 18:37 +0100
                Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-09 11:53 -0800
                Re: NULL as the empty string supercat@casperkitty.com - 2017-12-12 10:49 -0800
                Re: NULL as the empty string Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-12-12 13:39 -0800
                Re: NULL as the empty string supercat@casperkitty.com - 2017-12-12 16:05 -0800
                Re: NULL as the empty string Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-12-13 03:43 -0800
                Re: NULL as the empty string supercat@casperkitty.com - 2017-12-13 08:45 -0800
                Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-13 09:12 -0800
                Re: NULL as the empty string Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-12-13 13:27 -0800
                Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-13 14:02 -0800
                Re: NULL as the empty string asetofsymbols@gmail.com - 2017-12-13 14:58 -0800
                Re: NULL as the empty string asetofsymbols@gmail.com - 2017-12-13 15:11 -0800
                Re: NULL as the empty string Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-12-14 03:49 -0800
                Re: NULL as the empty string mark.bluemel@gmail.com - 2017-12-14 04:05 -0800
                Re: NULL as the empty string David Brown <david.brown@hesbynett.no> - 2017-12-14 13:09 +0100
                Re: NULL as the empty string Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-12-14 05:02 -0800
                Re: NULL as the empty string David Brown <david.brown@hesbynett.no> - 2017-12-14 14:54 +0100
                Re: NULL as the empty string supercat@casperkitty.com - 2017-12-14 07:38 -0800
                Re: NULL as the empty string Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-12-14 09:50 -0800
                Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-14 09:20 -0800
                Re: NULL as the empty string supercat@casperkitty.com - 2017-12-14 09:53 -0800
                Re: NULL as the empty string Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-12-14 12:57 -0800
                Re: NULL as the empty string herrmannsfeldt@gmail.com - 2017-12-14 17:22 -0800
                Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-14 17:26 -0800
      Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-12-08 21:23 +0100
        Re: NULL as the empty string Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2017-12-08 13:41 -0800
          Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-12-08 22:54 +0100
  Re: NULL as the empty string supercat@casperkitty.com - 2017-11-21 15:17 -0800
    Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-22 00:26 +0100
      Re: NULL as the empty string supercat@casperkitty.com - 2017-11-21 16:03 -0800
  Re: NULL as the empty string "Pascal J. Bourguignon" <pjb@informatimago.com> - 2017-11-22 00:27 +0100
    Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-22 00:42 +0100
      Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-11-21 16:05 -0800
        Re: NULL as the empty string herrmannsfeldt@gmail.com - 2017-12-06 22:33 -0800
          Re: NULL as the empty string supercat@casperkitty.com - 2017-12-07 12:04 -0800
            Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-12-07 23:20 +0100
              Re: NULL as the empty string supercat@casperkitty.com - 2017-12-07 15:04 -0800
  Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-11-21 15:28 -0800
  Re: NULL as the empty string Thiago Adams <thiago.adams@gmail.com> - 2017-11-21 16:04 -0800
  Re: NULL as the empty string Siri Cruise <chine.bleu@yahoo.com> - 2017-11-21 16:25 -0800
    Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-11-22 01:34 +0100
  Re: NULL as the empty string bartc <bc@freeuk.com> - 2017-11-22 00:36 +0000
  Re: NULL as the empty string Öö Tiib <ootiib@hot.ee> - 2017-11-21 23:07 -0800
  NULL as the empty string asetofsymbols@gmail.com - 2017-11-23 22:23 -0800
  Re: NULL as the empty string Geoff <geoff@invalid.invalid> - 2017-12-09 09:05 -0800
    Re: NULL as the empty string Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2017-12-09 12:40 -0500
  Re: NULL as the empty string gordonb.yj0bc@burditt.org (Gordon Burditt) - 2017-12-09 13:50 -0600
  Re: NULL as the empty string Ian Collins <ian-news@hotmail.com> - 2017-12-10 08:59 +1300
    Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-09 12:22 -0800
      Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-12-11 01:42 +0100
        Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-10 19:20 -0800
          Re: NULL as the empty string jacobnavia <jacob@jacob.remcomp.fr> - 2017-12-11 18:56 +0100
            Re: NULL as the empty string Keith Thompson <kst-u@mib.org> - 2017-12-11 11:19 -0800
        Re: NULL as the empty string supercat@casperkitty.com - 2017-12-15 09:29 -0800
          Re: NULL as the empty string Thiago Adams <thiago.adams@gmail.com> - 2018-01-05 08:28 -0800
            Re: NULL as the empty string supercat@casperkitty.com - 2018-01-05 09:37 -0800
              Re: NULL as the empty string Thiago Adams <thiago.adams@gmail.com> - 2018-01-05 17:08 -0800
    Re: NULL as the empty string supercat@casperkitty.com - 2017-12-15 09:18 -0800

csiph-web