comp.lang.ada
 help / color / mirror / Atom feed
  • [parent not found: <marnoldDJEvtJ.1Lx@netcom.com>]
  • [parent not found: <4cd8fc$oud@news.manawatu.gen.nz>]
  • * Re: Number representation (was: Hungarian notation - whoops!)
           [not found] <30C40F77.53B5@swsbbs.com>
                       ` (2 preceding siblings ...)
           [not found] ` <4cd8fc$oud@news.manawatu.gen.nz>
    @ 1996-02-19  0:00 ` Richard A. O'Keefe
           [not found] ` <4fc157$jsf@goanna.cs.rmit.EDU.AU>
      4 siblings, 0 replies; 172+ messages in thread
    From: Richard A. O'Keefe @ 1996-02-19  0:00 UTC (permalink / raw)
    
    
    tsw@3do.com (Tom Watson) writes:
    
    >In article <4fms62$c0p@goanna.cs.rmit.EDU.AU>, ok@goanna.cs.rmit.EDU.AU
    >(Richard A. O'Keefe) wrote:
    
    >> 
    >> >By the way, S&M is of course the right representation of floating-point,
    >> >using 2's complement for floating-point is a goof that only a designer
    >> >not understanding fpt would make!
    >> 
    
    I did _not_ write that, I _quoted_ it.
    
    >I'm not so sure.  With sign & magnitude you get TWO representations of the
    >same number (zero).
    
    In the B6700, you did indeed get two representations of 0, but unless you
    used some non-standard extensions
    	(-0 .EQ. 0) but (.NOT.(-0 .IS. 0))
    nothing in your program could depend on this fact.  The presence of two
    signed integer zeros (which were the same as the two signed floating point
    zeros) was something that a programmer could and did completely ignore.
    All the hardware had to do was to make sure that -0 and +0 acted the same
    in ordinary comparisons.
    
    >Some may argue that the difference is that negative
    >zero is what a very small negative number decays into, and positive zero
    >is what a very small positive number decays into.
    
    That is not the way it worked in the B6700 or the DECsystem-10.  So you
    have two representations of 0 with identical arithmetic properties.  So
    what?  Comparison hardware has to worry, programmers don't.  The VAX
    uses (used?) a sign-and-magnitude format, but never generated -0.0 and
    regarded the "-0.0" representation as an "illegal operand".
    
    As for IEEE arithmetic, I find that it helps to think of it as having
    NO representation for 0.  Instead, it can represent
    	-1/epsilon,
    	    <negative finite numbers>,
    		-epsilon
    		<NO zero>
    		+epsilon
    	    <positive finite numbers>
    	+1/epsilon
    
    >My understanding of numbers (no, I'm not an expert at this!)  is that
    >zero is only ONE number (basically without sign).  Most numbering
    >systems (like two's complement integers) have put in the positive
    >domain.
    
    >Programs didn't need to test for
    >multiple incantations of zero (which needs to be done with IEEE numbers if
    >the hardware doesn't detect BOTH forms).
    
    Should "incantations" be "incarnations"?
    If the hardware doesn't process +0 and -0 and process them distinctly,
    isn't IEEE.
    
    >As far as I can see, the only good thing (tm) that multiple (+ & -) zeros
    >gets you is multiple infinities when you divide by it (which may be the
    >object).  As long as both positive and negative numbers exist, and there
    >is SOME method of making a bit pattern happen for each of them that are
    >defined, it probably doesn't mean much which bits are turned on (use gray
    >code, I don't care).  Just make sure that all the operations necessary are
    >working, and give proper (documented) results.
    
    I think I should make it clear that when I criticised twos-complement as
    silly because it significantly complicates the arithmetic model that the
    programmer has to work with, I was not particularly concerned about the
    hardware representation of numbers.  To a programmer who "grew up" with
    a machine having 48 data bits of which numbers used only 47, it is obvious
    that the connection between numbers and bits is only conventional.  (For
    example, you could pack 6 EBCDIC characters per word using bit instructions,
    but try to do it using integer arithmetic and you were sure of an overflow.)
    
    What I care about is programs running on "hopefully sufficiently large"
    machines that turn out _not_ to be "sufficiently large" being quietly
    given wrong answers.
    
    There are occasions when Ada 95's modular types are exactly the right thing
    to use.  There are many more when plain integer types are right, and I'm
    glad that Ada _encourages_ overflow detection.
    
    
    From ok Mon Feb 19 18:10 EST 1996
    Received: (from ok@localhost) by goanna.cs.rmit.EDU.AU (8.7.1/8.6.9) id SAA15322; Mon, 19 Feb 1996 18:10:40 +1100 (EST)
    Date: Mon, 19 Feb 1996 18:10:40 +1100 (EST)
    From: "Richard A. O'Keefe" <ok>
    Message-Id: <199602190710.SAA15322@goanna.cs.rmit.EDU.AU>
    To: ok
    Subject: follow failed
    Content-Type: text
    Content-Length: 1504
    
    posted, but mailed to the moderator for approval.
    
    Your response has been saved in ~/dead.letter
    
    Your article follows:
    Newsgroups: comp.lang.c.moderated
    Subject: Re: But DO C hackers code concisely?
    References: <4fa7e7$2pu@solutions.solon.com> <4fst4u$2f1@solutions.solon.com> <4fvh88$e3l@solutions.solon.com>
    
    "Robert F. Monroe" <Robert@hever.demon.co.uk> writes:
    >What conceivable use could there be for either printf or scanf in a 
    >Windows DLL? The very nature of Windows I/O would cause them to only 
    >produce garbage.
    
    Well, the C standard *requires* them.  If you haven't got printf() and
    scanf(), you haven't got a "hosted" C implementation. 
    	printf(~~1~~)		===	fprintf(stdout, ~~1~~)
    and	scanf(~~2~~)		===	fscanf(stdin, ~~2~~)
    so the problem is not printf and scanf per se but stdin and stdout, and
    if you haven't got _them_ you haven't got a conforming "hosted" C
    implementation either.
    
    One very good reason for having them in the library is precisely to catch
    code which has been ported to Windows but incompletely.  Since Microsoft C
    has exceptions, I would think it appropriate for
    	- input from stdin, however expressed
    	- output to stdout, however expressed
    to raise an exception, and for the library to define printf &c so that user
    code cannot accidentally rely on defining them to do something different.
    getchar, putchar, printf, scanf, could all share the same few "raise
    exception" bytes.
    
    In any case, this is irrelevant to the original example, which used
    	sprintf
    not printf.
    
    
    From ok Mon Feb 19 18:17 EST 1996
    Received: (from ok@localhost) by goanna.cs.rmit.EDU.AU (8.7.1/8.6.9) id SAA15797; Mon, 19 Feb 1996 18:17:38 +1100 (EST)
    Date: Mon, 19 Feb 1996 18:17:38 +1100 (EST)
    From: "Richard A. O'Keefe" <ok>
    Message-Id: <199602190717.SAA15797@goanna.cs.rmit.EDU.AU>
    To: ok
    Subject: follow failed
    Content-Type: text
    Content-Length: 1348
    
    posted, but mailed to the moderator for approval.
    
    Your response has been saved in ~/dead.letter
    
    Your article follows:
    Newsgroups: comp.lang.c.moderated
    Subject: Re: But DO C hackers code concisely?
    References: <4fa7e7$2pu@solutions.solon.com> <4fst4u$2f1@solutions.solon.com>
    
    I gave the example of complex code that could have been replaced by
    tiny calls to sprintf.
    
    Michael Smith <msmith@mpx.com.au> writes:
    >Yes I do think that MS leaving these functions out is realy stupid,
    >but you have to work with the tools you have.
    
    This doesn't in the least spoil my argument.  Assume that leaving the
    printf() and scanf() _families_ out of the library used with DLLs is a
    good decision, and ignoring wsprintf(),
    (a) This wasn't a DLL, it was a complete program.
    (b) Converting integers from binary to text is pretty useful.  If sprintf()
        is not available, or if efficiency is a concern and sprintf() proves slow,
        the answer is to write functions
    
    	struct Integer_Format {
    	    unsigned char base;	/* 2, 8, 10, 16 */
    	    unsigned char pad ;
    	    unsigned char width; /* a minimum value */
    	};
    	static const struct Integer_Format plain = {10, ' ', 1};
    
    	ltostr(char *buf, long val, struct Integer_Format *);
    	ultostr(char *buf, unsigned long val, struct Integer_Format *);
    
        or something similar, and stick them in your personal library.
    
    
    -- 
    Election time; but how to get Labour _out_ without letting Liberal _in_?
    Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.
    
    
    
    
    ^ permalink raw reply	[flat|nested] 172+ messages in thread
  • [parent not found: <4fc157$jsf@goanna.cs.rmit.EDU.AU>]
  • [parent not found: <4adem2$b5s@mercury.IntNet.net>]
    * Re: Hungarian notation
    @ 1996-05-15  0:00 Bob Crispen
      0 siblings, 0 replies; 172+ messages in thread
    From: Bob Crispen @ 1996-05-15  0:00 UTC (permalink / raw)
    
    
    
    Peter Seebach <seebs@SOLUTIONS.SOLON.COM> sez:
    
    >>The intelligent
    >>reader will be able to see how Eiffel automatically supports many of
    >>the goals of Hungarian notation, and how other goals still need to
    >>be addresses.
    >
    >And the intelligent reader will also note that the system proposed is
    >actually detrimental to competent C programming, and encourages, even
    >*enforces*, the kinds of poor practices us poor C programmers are so
    >disparaged for.
    
    Boys and girls, I'd like it very, very much if we could avoid our
    Annual Hungarian Notation Fight this year.  Please note that, just like
    the Mac-vs-PC wars, the right-to-life-vs-pro-choice wars, and oh, ever
    so many others, NOT ONE PERSON has ever been convinced away from his
    or her position by the undoubtedly eloquent arguments of the other side.
    
    If you have a position on Hungarian Notation, would you *please* keep
    it to yourself?  Or at any rate, keep it off of comp.lang.ada?  If you
    absolutely *have* to say something on this issue, would you please pick
    a net friend to share it with and privately email it?
    
    Just consider yourself to have won the fight and drop it, OK?
    
    Thank you very much.
    
    p.s., if there are jobs open for programmers in Hungary, would you
    please use the word Magyar?  I'm fixin' to ignore *everything* that
    has "Hungarian" in the subject line.  I suggest the rest of you do, too.
    
    Bob Crispen
    revbob@eight-ball.hv.boeing.com
    Speaking for myself, not my company
    
    
    
    
    ^ permalink raw reply	[flat|nested] 172+ messages in thread
    * Re: Hungarian notation
    @ 1996-06-10  0:00 Bob Crispen
      0 siblings, 0 replies; 172+ messages in thread
    From: Bob Crispen @ 1996-06-10  0:00 UTC (permalink / raw)
    
    
    
    "Richard A. O'Keefe" <ok@GOANNA.CS.RMIT.EDU.AU> sez:
    
    >z007400b@bcfreenet.seflin.lib.fl.us (Ralph Silverman) writes:
    >>       why not major in
    >>               hegelian metaphysics
    >>       or
    >>               creative writing (modern poetry)
    >
    >For many students, the literally correct answer is "because a major in
    >creative writing is not a meal ticket, but a major in computing is."
    >
    >Dijkstra once wrote that the two prerequisites for becoming a good
    >programmer were
    >    - a propensity (my word, not his) for mathematics
    >    - mastery of ones native language.
    
    Charles Moore, the inventor of the epitome of write-only languages
    (Forth) said "The one tool every programmer must have on his desktop
    is a thesaurus."  Perhaps Forth is readable, and we've just been using
    bad symbolic names. ;-)
    
    The current Scientific American reports results on a study of Alzheimer's
    disease among a group of nuns.  The finding was that those nuns who had
    as early in life as age 20 written in short, less connected sentences had
    a significantly higher probability than those nuns who wrote longer,
    more narrative-like sentences of getting Alzheimers in old age.
    
    I immediately thought of nursing homes filled to overflowing with
    engineers.
    
    I despair at examples like:
    
    >   if Value in Limit_1 .. Limit_2 then         if Limit_2 >= Limit_1 and
    >      -- note possibility of null range           Value   >= Limit_1 and
    >      -- [ see LRM 3.5(4) & 4.5.2(27-32) ]        Value   <= Limit_2   then
    
    and will now use them in place of the standard example of bad commenting:
    
            LDA     #1      Move a '1' to register A
    
    What's next?
    
            procedure Foo is
            --
            -- procedure (pro-CE-dure) n., a thingy that procedes
    
    Bob Crispen
    revbob@eight-ball.hv.boeing.com
    Speaking for myself, not my company
    
    
    
    
    ^ permalink raw reply	[flat|nested] 172+ messages in thread

    end of thread, other threads:[~1996-06-22  0:00 UTC | newest]
    
    Thread overview: 172+ messages (download: mbox.gz / follow: Atom feed)
    -- links below jump to the message on this page --
         [not found] <30C40F77.53B5@swsbbs.com>
         [not found] ` <30EF0415.6FE1@tus.ssi1.com>
         [not found]   ` <1996Jan7.045815.8676@ohstpy>
         [not found]     ` <4cpb00$nqk@news.xmission.com>
    1996-01-08  0:00       ` Hungarian notation Michael Feathers
    1996-01-08  0:00         ` vancleef
    1996-01-09  0:00         `  Todd Knarr 
    1996-01-09  0:00           ` Michael Feathers
         [not found]       ` <hawkfish-0801960904580001@blv-pm3-ip24.halcyon.com>
    1996-01-09  0:00         `  Todd Knarr 
         [not found] ` <marnoldDJEvtJ.1Lx@netcom.com>
         [not found]   ` <4aleun$jlk@ns.RezoNet.NET>
         [not found]     ` <marnoldDJMDBG.CFz@netcom.com>
         [not found]       ` <4asnkr$7b0@solutions.solon.com>
         [not found]         ` <4ath75$e7i@barnacle.iol.ie>
         [not found]           ` <4b4kij$svt@news.microsoft.com>
         [not found]             ` <dewar.819489496@schonberg>
         [not found]               ` <4bd <4cne0e$1020@seminole.gate.net>
    1996-01-08  0:00                 ` Adam Beneschan
    1996-01-08  0:00                 ` Bob Kitzberger
    1996-01-08  0:00               ` Michael Feathers
         [not found] ` <4cd8fc$oud@news.manawatu.gen.nz>
    1996-01-08  0:00   ` Joachim Durchholz
    1996-02-19  0:00 ` Number representation (was: Hungarian notation - whoops!) Richard A. O'Keefe
         [not found] ` <4fc157$jsf@goanna.cs.rmit.EDU.AU>
         [not found]   ` <dewar.823793746@schonberg>
         [not found]     ` <4fms62$c0p@goanna.cs.rmit.EDU.AU>
         [not found]       ` <4ft1ruINN6dr@keats.ugrad.cs.ubc.ca>
    1996-02-19  0:00         ` Hungarian notation - whoops! Richard A. O'Keefe
    1996-02-21  0:00           ` Lawrence Kirby
    1996-02-22  0:00           ` Kazimir Kylheku
         [not found] <4adem2$b5s@mercury.IntNet.net>
         [not found] ` <4ahka7$o9m@inrou.erno.de>
    1996-05-13  0:00   ` Hungarian notation Roger Merritt
    1996-05-14  0:00     ` The Right Reverend Colin James III
    1996-05-15  0:00       ` Graham Perkins
    1996-05-15  0:00         ` Peter Seebach
    1996-05-16  0:00           ` Pete Becker
    1996-05-14  0:00     ` David Priest
    1996-05-14  0:00     ` Keith Whittingham
    1996-05-14  0:00       ` Peter Seebach
    1996-05-14  0:00         ` Pete Becker
         [not found]           ` <4ndb2j$1p0q@uni.library.ucla.edu>
    1996-05-16  0:00             ` Steve Branam
    1996-05-16  0:00             ` Scott
    1996-05-16  0:00               ` Giuliano Carlini
    1996-05-18  0:00                 ` Warren Young
    1996-05-16  0:00             ` Mark Chu-Carroll
    1996-05-16  0:00               ` Jay Martin
    1996-05-17  0:00                 ` Scott
    1996-05-23  0:00                 ` G.O.Visser
    1996-05-16  0:00         ` Matt Kennel
    1996-05-14  0:00       ` Dave Mikesell
    1996-05-14  0:00       ` Dr S.J. Harris
    1996-05-15  0:00         ` Gerolf Wendland
    1996-05-16  0:00           ` mAg
    1996-05-17  0:00             ` Arne W Flones
    1996-05-21  0:00               ` Norman L. Reitzel   
    1996-05-21  0:00                 ` Bob Rodgers
    1996-05-22  0:00                   ` Michael Furman
    1996-05-22  0:00                   ` Matt Kennel
    1996-05-23  0:00                     ` Bob Rodgers
    1996-05-23  0:00                       ` Peter Seebach
    1996-05-23  0:00                     ` Steve Willer
    1996-05-23  0:00                       ` Richard A. O'Keefe
    1996-05-23  0:00                         ` Steve Willer
    1996-05-23  0:00                   ` Peter Moylan
    1996-05-21  0:00                 ` Richard A. O'Keefe
    1996-05-22  0:00                   ` Peter Moylan
    1996-05-23  0:00                     ` Andy Ho-Fan Chan
    1996-05-23  0:00                       ` Robert Dewar
    1996-05-24  0:00                         ` Bob Rodgers
    1996-05-24  0:00                         ` Robert A Duff
    1996-05-28  0:00                           ` Richard A. O'Keefe
    1996-05-28  0:00                             ` Janus
    1996-05-28  0:00                             ` Jeff Dege
    1996-05-29  0:00                             ` Chris Kuan
    1996-05-29  0:00                               ` Bob Rodgers
    1996-05-30  0:00                                 ` Chris Kuan
    1996-05-29  0:00                             ` Michael Furman
    1996-05-31  0:00                               ` Richard A. O'Keefe
    1996-06-01  0:00                                 ` Warren Young
    1996-06-01  0:00                                 ` Steve Willer
    1996-06-03  0:00                                   ` Warren Young
    1996-05-31  0:00                             ` Will Rose
    1996-06-05  0:00                               ` Ralph Silverman
    1996-06-07  0:00                                 ` Michael Furman
    1996-06-01  0:00                             ` Heinz Hemken
    1996-06-02  0:00                               ` Matt Kennel
    1996-06-02  0:00                               ` Jeff Dege
    1996-06-05  0:00                               ` Ralph Silverman
    1996-06-06  0:00                                 ` Jeff Dege
    1996-05-27  0:00                       ` Peter Moylan
    1996-05-27  0:00                         ` Jeff Dege
    1996-05-27  0:00                           ` The Amorphous Mass
    1996-05-28  0:00                             ` Jeff Dege
    1996-05-28  0:00                               ` The Amorphous Mass
    1996-05-28  0:00                       ` Richard A. O'Keefe
    1996-06-06  0:00                       ` Sam Hunting
    1996-06-06  0:00                       ` Ralph Silverman
    1996-06-06  0:00                         ` David Hopkins
    1996-06-07  0:00                         ` Richard A. O'Keefe
    1996-06-07  0:00                           ` Steve Willer
    1996-06-10  0:00                             ` Michael Furman
    1996-06-12  0:00                               ` Warren Young
    1996-05-23  0:00                     ` Robert Dewar
    1996-05-23  0:00                       ` Steve Willer
    1996-05-28  0:00                         ` Richard A. O'Keefe
    1996-05-29  0:00                           ` Kevin Cline
    1996-05-24  0:00                       ` Kevin Cline
    1996-05-25  0:00                         ` Steve Willer
    1996-06-05  0:00                         ` Ralph Silverman
    1996-06-06  0:00                           ` James McKim
    1996-06-07  0:00                             ` Ralph Silverman
    1996-06-06  0:00                           ` Richard A. O'Keefe
    1996-05-24  0:00                       ` Jeff Dege
    1996-05-26  0:00                       ` Warren Young
    1996-06-03  0:00                     ` Norman H. Cohen
    1996-06-10  0:00                 ` Ralph Silverman
    1996-05-18  0:00             ` Richard Riehle
    1996-05-23  0:00             ` Laurent Guerby
    1996-05-23  0:00             ` James Kanze US/ESC 60/3/141 #40763
    1996-05-23  0:00               ` Paul J. Kossick
    1996-05-25  0:00                 ` Raoul De Kezel
    1996-05-23  0:00             ` Robert I. Eachus
    1996-06-05  0:00             ` Ralph Silverman
    1996-06-05  0:00               ` jthorpe
    1996-06-06  0:00               ` Richard A. O'Keefe
    1996-06-07  0:00                 ` Chris Kuan
    1996-06-07  0:00                 ` Ralph Silverman
    1996-06-07  0:00                   ` The Amorphous Mass
    1996-06-10  0:00                   ` Michael Furman
    1996-06-11  0:00                   ` Richard A. O'Keefe
    1996-06-11  0:00                     ` Kevin Cline
    1996-06-11  0:00                       ` Chris Engebretson
    1996-06-11  0:00                       ` Ralph Silverman
    1996-06-12  0:00                       ` Bob Rodgers
    1996-06-12  0:00                         ` Matt Kennel
    1996-06-13  0:00                           ` Giuliano Carlini
    1996-06-13  0:00                           ` Jeff Dege
    1996-06-22  0:00                       ` Richard Green
    1996-06-11  0:00                     ` Will Rose
    1996-06-05  0:00           ` Ralph Silverman
    1996-05-16  0:00       ` Dave Toland
    1996-05-21  0:00       ` mAg
    1996-05-21  0:00         ` Bob Lang 3P21 x3172
    1996-05-21  0:00         ` Peter Seebach
    1996-05-23  0:00           ` Steve Willer
    1996-05-23  0:00             ` Peter Seebach
    1996-05-23  0:00             ` Richard A. O'Keefe
    1996-05-23  0:00               ` Train
    1996-05-23  0:00                 ` jeffos2
    1996-05-23  0:00               ` Bob Rodgers
    1996-05-23  0:00                 ` Bob Kitzberger
    1996-05-23  0:00               ` Robert Dewar
    1996-05-28  0:00                 ` Richard A. O'Keefe
    1996-05-23  0:00             ` Robert Dewar
    1996-05-24  0:00               ` Steve Willer
    1996-05-24  0:00               ` slary61
    1996-05-24  0:00                 ` Jos A. Horsmeier
    1996-05-26  0:00                   ` Richard Riehle
    1996-05-27  0:00                     ` Warren Young
    1996-06-03  0:00                     ` Eva
    1996-05-28  0:00                   ` Paul D. DeRocco
    1996-05-24  0:00                 ` Dave Toland
    1996-05-24  0:00                 ` Jerry Kuch
    1996-05-24  0:00                 ` Jeff Dege
    1996-05-24  0:00                 ` Ian Ward
    1996-05-27  0:00                 ` Norman L. Reitzel   
    1996-05-27  0:00                   ` Matt Kennel
    1996-05-28  0:00                 ` Richard A. O'Keefe
    1996-05-28  0:00                   ` Jay Martin
    1996-05-29  0:00                     ` Richard A. O'Keefe
    1996-06-01  0:00                     ` Michael Feldman
    1996-05-29  0:00                 ` AJ Musgrove
    1996-06-05  0:00                 ` Ralph Silverman
    1996-06-06  0:00                 ` Ralph Silverman
    1996-05-21  0:00         ` Mark A Biggar
    1996-05-21  0:00           ` slary61
    1996-05-24  0:00         ` Oleg Kagan
    1996-06-05  0:00           ` Ralph Silverman
    1996-05-23  0:00     ` James Kanze US/ESC 60/3/141 #40763
    1996-05-28  0:00     ` Brian Rogoff
    1996-05-28  0:00     ` Homonnai Misi
    1996-05-20  0:00   ` James Kanze US/ESC 60/3/141 #40763
    1996-05-20  0:00     ` Tom Wheeley
    1996-05-23  0:00     ` Steve Willer
    1996-05-22  0:00   ` James Kanze US/ESC 60/3/141 #40763
    1996-05-23  0:00   ` James Kanze US/ESC 60/3/141 #40763
    1996-05-23  0:00     ` Richard Kenner
    1996-06-01  0:00   ` Jim Kingdon
    1996-05-15  0:00 Bob Crispen
      -- strict thread matches above, loose matches on Subject: below --
    1996-06-10  0:00 Bob Crispen
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox