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


Groups > comp.arch > #1374 > unrolled thread

Re: Computer arithmetic problems worth exploring

Started byGeorge Neuner <gneuner2@comcast.net>
First post2011-05-07 03:06 -0400
Last post2011-05-09 16:08 -0700
Articles 20 on this page of 124 — 27 participants

Back to article view | Back to comp.arch

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-07 03:06 -0400
    Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-07 09:44 +0100
      Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-07 11:38 +0100
        Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-07 12:21 +0100
          Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-07 13:47 +0100
            Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-07 09:55 -0700
              Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-07 19:27 +0100
                Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-07 13:54 -0700
                  Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-09 13:38 -0400
                    Re: Computer arithmetic problems worth exploring Robert A Duff <bobduff@shell01.TheWorld.com> - 2011-05-10 12:40 -0400
                      Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-10 20:32 +0200
              Re: Computer arithmetic problems worth exploring torbenm@diku.dk (Torben Ægidius Mogensen) - 2011-05-09 13:42 +0200
      Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-07 04:26 -0700
        Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-07 12:13 +0100
    Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-07 14:59 -0700
      Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-09 14:14 -0400
        Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-09 20:38 +0100
        Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-09 13:55 -0700
          Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-10 09:05 +0100
            Re: Computer arithmetic problems worth exploring Jason Riedy <jason@lovesgoodfood.com> - 2011-05-10 13:24 -0400
              Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-10 18:41 +0100
              Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-11 13:56 -0700
              Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-11 14:04 -0700
              Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-11 14:06 -0700
            Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-11 13:55 -0700
              Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-11 22:15 +0100
                Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-12 20:52 +0100
                  Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-12 20:20 +0100
                    Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-12 14:55 -0700
                  Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-13 12:25 +0200
                    Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-13 11:18 +0100
                      Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-14 13:19 -0700
                        Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-14 19:11 -0700
                Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-12 20:08 -0700
              Re: Computer arithmetic problems worth exploring Jason Riedy <jason@lovesgoodfood.com> - 2011-05-12 23:54 -0400
          Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-12 01:08 -0400
            Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-12 09:27 +0100
              Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-12 05:41 -0700
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-12 13:22 +0100
                  Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-12 07:22 -0700
                    Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-12 14:58 +0100
                      Re: Computer arithmetic problems worth exploring MitchAlsup <MitchAlsup@aol.com> - 2011-05-12 09:23 -0700
                      Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-12 22:59 +0000
                        Re: Non-constant initializers Ian Collins <ian-news@hotmail.com> - 2011-05-13 11:07 +1200
                          Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-12 23:17 +0000
                            Re: Non-constant initializers Ian Collins <ian-news@hotmail.com> - 2011-05-13 11:20 +1200
                              Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-12 23:30 +0000
                                Re: Non-constant initializers Ian Collins <ian-news@hotmail.com> - 2011-05-13 11:34 +1200
                                  Re: Non-constant initializers Keith Thompson <kst-u@mib.org> - 2011-05-12 16:52 -0700
                                    Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-14 00:13 +0000
                                      Re: Non-constant initializers kym@kymhorsell.com - 2011-05-14 01:54 +0000
                                        Re: Non-constant initializers Columbus sailed the ocean China Blue <chine.bleu@yahoo.com> - 2011-05-14 01:07 -0700
                                          Re: Non-constant initializers kym@kymhorsell.com - 2011-05-14 09:22 +0000
                                            Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-14 17:14 +0000
                                  Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-14 00:11 +0000
                        Re: Non-constant initializers Columbus sailed the ocean China Blue <chine.bleu@yahoo.com> - 2011-05-12 16:15 -0700
                          Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-12 23:28 +0000
                        Re: Non-constant initializers Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-05-12 18:01 -0600
                          Re: Non-constant initializers Keith Thompson <kst-u@mib.org> - 2011-05-12 18:15 -0700
                            Re: Non-constant initializers Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-05-12 22:56 -0600
                              Re: Non-constant initializers Seebs <usenet-nospam@seebs.net> - 2011-05-13 05:18 +0000
                          Re: Non-constant initializers Fred the Freshwater Catfish <usenet.fred@bdtd.invalid> - 2011-05-13 23:57 +0000
              Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-12 20:20 -0700
                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-13 09:48 +0100
                  Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-13 12:55 +0200
                    Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-13 11:25 +0100
                      Re: Computer arithmetic problems worth exploring MitchAlsup <MitchAlsup@aol.com> - 2011-05-13 08:57 -0700
                        Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-13 16:42 +0100
                          Re: Computer arithmetic problems worth exploring MitchAlsup <MitchAlsup@aol.com> - 2011-05-13 13:17 -0700
                            Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-13 21:03 +0100
                            Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-14 06:43 +0200
                              Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-14 06:55 +0100
                                Re: Computer arithmetic problems worth exploring "Ken Hagan" <k.hagan@thermoteknix.com> - 2011-05-17 12:59 +0100
                                  Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-17 12:44 +0100
                                    Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-17 14:07 +0100
                                      Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-17 17:20 +0100
                                    Re: Computer arithmetic problems worth exploring "Ken Hagan" <k.hagan@thermoteknix.com> - 2011-05-17 15:03 +0100
                              Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-14 08:43 +0100
                                Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-14 09:17 +0100
                            Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-14 09:04 -0700
                            Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-14 17:00 -0700
                        Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-14 16:58 -0700
                          Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-14 19:07 -0700
                            Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-15 09:40 +0100
                            Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-16 11:05 +0200
                              Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-16 06:44 -0700
                                Re: Computer arithmetic problems worth exploring mac <acolvin@efunct.com> - 2011-05-19 20:17 +0000
                                  Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-19 15:20 -0700
                                    Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-19 18:51 -0400
                                      Re: Computer arithmetic problems worth exploring Petter Gustad <newsmailcomp6@gustad.com> - 2011-05-20 08:01 +0200
                                        Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-20 15:09 -0700
                                      Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-20 08:54 +0200
                                        Re: Computer arithmetic problems worth exploring "Ken Hagan" <k.hagan@thermoteknix.com> - 2011-05-23 11:11 +0100
                                          Re: Computer arithmetic problems worth exploring George Neuner <gneuner2@comcast.net> - 2011-05-23 18:20 -0400
                                        Re: Computer arithmetic problems worth exploring Morten Reistad <first@last.name> - 2011-06-03 08:21 +0200
                                Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-19 13:31 -0700
                              Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-16 09:05 -0700
                                Re: Computer arithmetic problems worth exploring Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-16 22:37 +0200
                                  Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-18 23:16 -0700
                                Re: Computer arithmetic problems worth exploring ChrisQ <meru@devnull.com> - 2011-05-17 17:10 +0100
                                  Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-17 17:27 +0100
                                    Re: Computer arithmetic problems worth exploring ChrisQ <meru@devnull.com> - 2011-05-17 23:08 +0100
                                    Re: Computer arithmetic problems worth exploring Tom <tggzzz@blueyonder.co.uk> - 2011-05-17 22:37 +0000
                                      Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-18 09:25 +0100
                                        Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-18 06:25 -0700
                                          Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-18 14:06 +0100
                                          Re: Computer arithmetic problems worth exploring Tom Gardner <spamjunk@blueyonder.co.uk> - 2011-05-18 19:23 +0100
                                            Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-18 13:48 -0700
                                              Re: Computer arithmetic problems worth exploring Andrew Reilly <areilly---@bigpond.net.au> - 2011-05-19 00:29 +0000
                                                Re: Computer arithmetic problems worth exploring "Ken Hagan" <k.hagan@thermoteknix.com> - 2011-05-19 13:12 +0100
                                  Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-18 23:27 -0700
                                    Re: Computer arithmetic problems worth exploring Quadibloc <jsavard@ecn.ab.ca> - 2011-05-19 15:19 -0700
                                      Re: Computer arithmetic problems worth exploring Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2011-05-20 07:33 -0700
                            Re: Computer arithmetic problems worth exploring Michael S <already5chosen@yahoo.com> - 2011-05-16 03:14 -0700
                              Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-16 10:43 +0100
                                Re: Computer arithmetic problems worth exploring Michael S <already5chosen@yahoo.com> - 2011-05-16 04:58 -0700
                                  Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-16 12:40 +0100
                          Re: Computer arithmetic problems worth exploring MitchAlsup <MitchAlsup@aol.com> - 2011-05-15 10:12 -0700
                  Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-14 13:22 -0700
                    Re: Computer arithmetic problems worth exploring nmm1@cam.ac.uk - 2011-05-15 09:02 +0100
                  Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-14 14:02 -0700
            Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-12 20:18 -0700
        Re: Computer arithmetic problems worth exploring Robert Myers <rbmyersusa@gmail.com> - 2011-05-09 14:32 -0700
          Re: Computer arithmetic problems worth exploring "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-09 16:08 -0700

Page 5 of 7 — ← Prev page 1 2 3 4 [5] 6 7  Next page →


#1578

From"Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net>
Date2011-05-14 17:00 -0700
Message-ID<4DCF17AB.5070801@SPAM.comp-arch.net>
In reply to#1551
On 5/13/2011 1:17 PM, MitchAlsup wrote:
> On May 13, 10:42 am, n...@cam.ac.uk wrote:
>> In article<4a613763-70c7-4a66-aa75-7ce3476cd...@x10g2000yqj.googlegroups.com>,
>>
>>
>>
>>
>>
>> MitchAlsup<MitchAl...@aol.com>  wrote:
>>
>>>>> Afair the idiom of "if ((0<  x) || (0>= x)) {" has been used in a bit
>>>>> of code to determine that (x) is a regular number, not a NaN. It does of
>>>>> course depend on both comparisons to fail when x is indeed NaN.
>>
>>>> Yes, they have.  That's not the point.
>>
>>> It seems to me that the inherent problem, here, is ::
>>
>>> "What is to be the effect of comparing things that are incomparable"?
>>
>>> Perhaps one should resurect the old FORTRAN IF and add a 4'th lable
>>
>>> 100  IF(X.NE.Y) 1,2,3,4
>>
>>> Where the 4'th label is delivered control if the operands are
>>> incomparible.
>>
>> Do you know SNOBOL? :-)
>
> A very long time ago--circa 1972
>
>> A modern version of that would be:
>>
>>      IF (...) THEN
>>          ...
>>      ELSE
>>          ...
>>      UNORDERED
>>          ...
>>      END IF
>>
>>> This seems to be at least as much a language issue as a HW
>>> computational issue.
>>
>> Oh, agreed, but IEEE 754 didn't get it wholly wrong, except for
>> the equality/inequality operator.  All of the other default ones
>> raise the invalid exception if one of the operands is a NaN,
>> which is correct in any environment where that exception always
>> indicates a serious error and cannot easily get lost.
>
> I seem to recall at least one machine of my college era (circa
> 1971-77) that did equality comparisons on Floats in such a way that if
> the numbers were equal to within 3lsb the equality flag was set (?
> 1108?). Thus: (1.0/3.0)*3.0 was equal to 1.0 even with (but a few)
> rounding errors.
>
> Would something like this help or just confuse the issue even more?


confyse the issue even more.

the usercan always do an (abs(a-b))<eps

but, also, you can always consider a compiler switch for the approximate 
equality compare.

[toc] | [prev] | [next] | [standalone]


#1577

From"Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net>
Date2011-05-14 16:58 -0700
Message-ID<4DCF1735.9050107@SPAM.comp-arch.net>
In reply to#1544
On 5/13/2011 8:57 AM, MitchAlsup wrote:
> On May 13, 5:25 am, n...@cam.ac.uk wrote:
>> In article<5afv98-e0u2....@ntp6.tmsw.no>,
>>> Afair the idiom of "if ((0<  x) || (0>= x)) {" has been used in a bit
>>> of code to determine that (x) is a regular number, not a NaN. It does of
>>> course depend on both comparisons to fail when x is indeed NaN.
>>
>> Yes, they have.  That's not the point.
>
> It seems to me that the inherent problem, here, is ::
>
> "What is to be the effect of comparing things that are incomparable"?
>
> Perhaps one should resurect the old FORTRAN IF and add a 4'th lable
>
> 100  IF(X.NE.Y) 1,2,3,4
>
> Where the 4'th label is delivered control if the operands are
> incomparible.
>
> This seems to be at least as much a language issue as a HW
> computational issue.
>
> Mitch

My thinking along this line is that if you an ordered comparison of 
NaNs, then it should fault.

E.g.  if(x>y){... should fault if either x or y is a NaN.

You should say if(isnan(x)){...}else if(isnan(y)){...}else if( x<y) {...

But, there are many idioms such as Terje mentioned: !(x<0||x>=0).
Deprecated compiler switch.

I also like the symbolic notations  ?>?, ?>, >?,
which are read as if( lhs is nan or greater than rhs ), etc.

Methinks also, if serious, then the FP compare should be a bitmask:

LT
EQ
GT
isnan(lhs)
isnan(rhs)

although I expect the usual attempts to

a) reduce the bits in the bitmask by arguing that certain combinations
are meaningless

b) complicate it by adding not and and and or combinations relating to 
the nans

[toc] | [prev] | [next] | [standalone]


#1583

FromQuadibloc <jsavard@ecn.ab.ca>
Date2011-05-14 19:07 -0700
Message-ID<8df7ead8-364c-41df-9938-ab9e09b8f29c@d15g2000yqn.googlegroups.com>
In reply to#1577
On May 14, 5:58 pm, "Andy \"Krazy\" Glew" <a...@SPAM.comp-arch.net>
wrote:

> You should say if(isnan(x)){...}else if(isnan(y)){...}else if( x<y) {...

In _general_ that is true enough.

But for most cases where a programmer is writing code to perform a
numerical calculation, what is desired is that the underlying
algorithm can be expressed in a simple and straightforward manner in
the programming language.

So, if it's harmful to assume one default handling of NaNs fits all
cases, what's needed is a language construct that appears at the
beginning of the module instructing the compiler what convention to
use.

At least that's what FORTRAN needs - in C, doing it your way would
better fit with the original purpose of that language, as a substitute
for assembler in systems programming. Due to the high availability of
C compilers, and the relative rarity of FORTRAN, so that many people
are using C when they should be using FORTRAN, though, probably the
option would be helpful even as part of the C language.

At least people aren't yet using C when they should be using COBOL.
*That* would end up turning it into PL/I.

John Savard

[toc] | [prev] | [next] | [standalone]


#1589

Fromnmm1@cam.ac.uk
Date2011-05-15 09:40 +0100
Message-ID<iqo3il$fh1$1@gosset.csi.cam.ac.uk>
In reply to#1583
In article <8df7ead8-364c-41df-9938-ab9e09b8f29c@d15g2000yqn.googlegroups.com>,
Quadibloc  <jsavard@ecn.ab.ca> wrote:
>On May 14, 5:58=A0pm, "Andy \"Krazy\" Glew" <a...@SPAM.comp-arch.net>
>wrote:
>
>> You should say if(isnan(x)){...}else if(isnan(y)){...}else if( x<y) {...
>
>In _general_ that is true enough.
>
>But for most cases where a programmer is writing code to perform a
>numerical calculation, what is desired is that the underlying
>algorithm can be expressed in a simple and straightforward manner in
>the programming language.

Precisely.  I believe that was an objective of IEEE 754 in 1984.

>So, if it's harmful to assume one default handling of NaNs fits all
>cases, what's needed is a language construct that appears at the
>beginning of the module instructing the compiler what convention to
>use.

Well, yes, but ONLY if the alternatives are all suitable for simple
use in the high-level language.  If the handling is a low-level
bypass for special purposes, then it is generally better to have
library functions or otherwise distinguished code.

>At least that's what FORTRAN needs - in C, doing it your way would
>better fit with the original purpose of that language, as a substitute
>for assembler in systems programming. Due to the high availability of
>C compilers, and the relative rarity of FORTRAN, so that many people
>are using C when they should be using FORTRAN, though, probably the
>option would be helpful even as part of the C language.

The original C design was plausible, if misguided in many respects,
but has gone downhill from there - and largely by being extended to
fulfil too many different purposes and by being designed by people
who believe that languages should have lots of facilities but need
not have a mathematical abstract model.

It ALREADY has such an option.  It doesn't actually have a
specification but, hey!, who needs those?

>At least people aren't yet using C when they should be using COBOL.
>*That* would end up turning it into PL/I.

See TRs 18037 and 24732 on http://www.open-std.org/jtc1/sc22/wg14/.


Regards,
Nick Maclaren.

[toc] | [prev] | [next] | [standalone]


#1606

FromTerje Mathisen <"terje.mathisen at tmsw.no">
Date2011-05-16 11:05 +0200
Message-ID<ev57a8-04a.ln1@ntp6.tmsw.no>
In reply to#1583
Quadibloc wrote:
> At least people aren't yet using C when they should be using COBOL.
> *That* would end up turning it into PL/I.

_Nobody_ uses C when they should be using COBOL, but that's simply 
because nobody should be using COBOL in the first place.

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

[toc] | [prev] | [next] | [standalone]


#1615

FromQuadibloc <jsavard@ecn.ab.ca>
Date2011-05-16 06:44 -0700
Message-ID<046d0c03-ff0a-4e7e-bd30-0509b6531639@z13g2000yqg.googlegroups.com>
In reply to#1606
On May 16, 3:05 am, Terje Mathisen <"terje.mathisen at tmsw.no">
wrote:
> Quadibloc wrote:
> > At least people aren't yet using C when they should be using COBOL.
> > *That* would end up turning it into PL/I.
>
> _Nobody_ uses C when they should be using COBOL, but that's simply
> because nobody should be using COBOL in the first place.

In that case, I misspoke.

Are people using C to write business-oriented accounting and database
applications? If so, are there alternate languages available which
they _should_ be using?

John Savard

[toc] | [prev] | [next] | [standalone]


#1699

Frommac <acolvin@efunct.com>
Date2011-05-19 20:17 +0000
Message-ID<1939760957327519177.686849acolvin-efunct.com@news.eternal-september.org>
In reply to#1615
> Are people using C to write business-oriented accounting and database
> applications? If so, are there alternate languages available which
> they _should_ be using?

Verilog. For speed and predictable latency. In a rack inside the trading
exchange. 

-- mac the naïf

[toc] | [prev] | [next] | [standalone]


#1706

FromQuadibloc <jsavard@ecn.ab.ca>
Date2011-05-19 15:20 -0700
Message-ID<3f3c7630-1335-4a8e-81bd-96f568fba486@r35g2000prj.googlegroups.com>
In reply to#1699
On May 19, 2:17 pm, mac <acol...@efunct.com> wrote:

quoting me
> > Are people using C to write business-oriented accounting and database
> > applications? If so, are there alternate languages available which
> > they _should_ be using?
>
> Verilog. For speed and predictable latency. In a rack inside the trading
> exchange.

That is... _obscene_.

John Savard

[toc] | [prev] | [next] | [standalone]


#1707

FromGeorge Neuner <gneuner2@comcast.net>
Date2011-05-19 18:51 -0400
Message-ID<ql7bt6tjuptb6nnk7vkegjse2b45rjv3ji@4ax.com>
In reply to#1706
On Thu, 19 May 2011 15:20:55 -0700 (PDT), Quadibloc
<jsavard@ecn.ab.ca> wrote:

>On May 19, 2:17 pm, mac <acol...@efunct.com> wrote:
>
>> Verilog. For speed and predictable latency. In a rack inside the trading
>> exchange.
>
>That is... _obscene_.
>
>John Savard

And frightening ... but probably true.
George

[toc] | [prev] | [next] | [standalone]


#1722

FromPetter Gustad <newsmailcomp6@gustad.com>
Date2011-05-20 08:01 +0200
Message-ID<87k4dlx64g.fsf@pangea.home.gustad.com>
In reply to#1707
George Neuner <gneuner2@comcast.net> writes:

> On Thu, 19 May 2011 15:20:55 -0700 (PDT), Quadibloc
> <jsavard@ecn.ab.ca> wrote:
>
>>On May 19, 2:17 pm, mac <acol...@efunct.com> wrote:
>>
>>> Verilog. For speed and predictable latency. In a rack inside the trading
>>> exchange.
>>
>>That is... _obscene_.
>>
>>John Savard
>
> And frightening ... but probably true.

I've seen some cases where FPGA's have been used in high frequency
trading applications.

//Petter

-- 
.sig removed by request. 

[toc] | [prev] | [next] | [standalone]


#1753

From"Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net>
Date2011-05-20 15:09 -0700
Message-ID<4DD6E683.4000807@SPAM.comp-arch.net>
In reply to#1722
On 5/19/2011 11:01 PM, Petter Gustad wrote:
> George Neuner<gneuner2@comcast.net>  writes:
>
>> On Thu, 19 May 2011 15:20:55 -0700 (PDT), Quadibloc
>> <jsavard@ecn.ab.ca>  wrote:
>>
>>> On May 19, 2:17 pm, mac<acol...@efunct.com>  wrote:
>>>
>>>> Verilog. For speed and predictable latency. In a rack inside the trading
>>>> exchange.
>>>
>>> That is... _obscene_.
>>>
>>> John Savard
>>
>> And frightening ... but probably true.
>
> I've seen some cases where FPGA's have been used in high frequency
> trading applications.
>
> //Petter

One of my friends, an occasional participant in this group, was hired 
to do some FPGA coding for high frequency trading.

Instead, he tuned the C code, and cleaned up the network stack.

[toc] | [prev] | [next] | [standalone]


#1725

FromTerje Mathisen <"terje.mathisen at tmsw.no">
Date2011-05-20 08:54 +0200
Message-ID<iqfha8-d6o.ln1@ntp6.tmsw.no>
In reply to#1707
George Neuner wrote:
> On Thu, 19 May 2011 15:20:55 -0700 (PDT), Quadibloc
> <jsavard@ecn.ab.ca>  wrote:
>
>> On May 19, 2:17 pm, mac<acol...@efunct.com>  wrote:
>>
>>> Verilog. For speed and predictable latency. In a rack inside the trading
>>> exchange.
>>
>> That is... _obscene_.
>>
>> John Savard
>
> And frightening ... but probably true.

Not nearly as frightening (or obscene) as the fact that at least the New 
York Stock Exchange, which was created to bring sellers and buyers 
together, on a more or less equal footing, now contains special 
provisions designed to tilt the balance strongly in favor of those that 
can afford to pay for rack space inside the exchange itself.

I.e. machine trading within the 5 ms (or so) window before anyone 
outside the exchange get to hear about the offers.

Afaik they even added a few ms of delay buffering to everyone except a 
few insiders, so that those fortunate few could have time to match up an 
offer to buy and an offer to sell, and gain money both ways, with zero risk?

Please note that the scenario above doesn't gain society as such 
anything at all, except in the form of employment for fresh MIT graduates.

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

[toc] | [prev] | [next] | [standalone]


#1783

From"Ken Hagan" <k.hagan@thermoteknix.com>
Date2011-05-23 11:11 +0100
Message-ID<op.vvxilkstjcamrv@khagan.ttx>
In reply to#1725
On Fri, 20 May 2011 07:54:40 +0100, Terje Mathisen <"terje.mathisen at  
tmsw.no"> wrote:

> I.e. machine trading within the 5 ms (or so) window before anyone  
> outside the exchange get to hear about the offers.

Now if *I* traded based on information that wasn't (yet) available to  
other people, I'd be done for "insider" trading. I wonder how the lawyers  
argue that it is OK to build a machine to perform an action that it would  
be illegal for a person to perform.

Of vague relevance to comp.arch is the fact that (on this evidence)  
society really hasn't woken up to what technology can do.

[toc] | [prev] | [next] | [standalone]


#1786

FromGeorge Neuner <gneuner2@comcast.net>
Date2011-05-23 18:20 -0400
Message-ID<j4nlt6ht78tp7qemf63mv1p6hpf4dk8lkd@4ax.com>
In reply to#1783
On Mon, 23 May 2011 11:11:34 +0100, "Ken Hagan"
<k.hagan@thermoteknix.com> wrote:

>On Fri, 20 May 2011 07:54:40 +0100, Terje Mathisen <"terje.mathisen at  
>tmsw.no"> wrote:
>
>> I.e. machine trading within the 5 ms (or so) window before anyone  
>> outside the exchange get to hear about the offers.
>
>Now if *I* traded based on information that wasn't (yet) available to  
>other people, I'd be done for "insider" trading. I wonder how the lawyers  
>argue that it is OK to build a machine to perform an action that it would  
>be illegal for a person to perform.
>
>Of vague relevance to comp.arch is the fact that (on this evidence)  
>society really hasn't woken up to what technology can do.

It's somehow connected to copyright: the exchange "owns" the
information and so - in theory - can choose who gets to see it and
when.  This is at odds with consumer protection so the compromise has
been to  give the preferred group only a short time to make use of the
information.

George

[toc] | [prev] | [next] | [standalone]


#2016

FromMorten Reistad <first@last.name>
Date2011-06-03 08:21 +0200
Message-ID<4de88a76$1@news.broadpark.no>
In reply to#1725
In article <iqfha8-d6o.ln1@ntp6.tmsw.no>,
Terje Mathisen  <"terje.mathisen at tmsw.no"> wrote:
>George Neuner wrote:
>> On Thu, 19 May 2011 15:20:55 -0700 (PDT), Quadibloc
>> <jsavard@ecn.ab.ca>  wrote:
>>
>>> That is... _obscene_.
>>>
>>> John Savard
>>
>> And frightening ... but probably true.
>
>Not nearly as frightening (or obscene) as the fact that at least the New 
>York Stock Exchange, which was created to bring sellers and buyers 
>together, on a more or less equal footing, now contains special 
>provisions designed to tilt the balance strongly in favor of those that 
>can afford to pay for rack space inside the exchange itself.

The european exchanges have deliberatly gone in the other direction.

Making systems that allow participants to gain advantages by exploiting
protocols, trading system "features", pilot errors etc is expressly
forbidden inside EU/EES.

Equal access, equal timing, equal resolution and equal execution and
enforced in all the trading systems I have seen here.

They even go to lengths of analysing RTT to client systems, and deliberatly
adding a jitter of (AVD+1SD)/2 jitter to transmitted data for any one
client.

There nas not been much controversy about this; and brokers and fund 
managers have been extensively consulted.

>I.e. machine trading within the 5 ms (or so) window before anyone 
>outside the exchange get to hear about the offers.

In a decent hosting environment 600 us should bring you across town
and back. 

>Afaik they even added a few ms of delay buffering to everyone except a 
>few insiders, so that those fortunate few could have time to match up an 
>offer to buy and an offer to sell, and gain money both ways, with zero risk?

That is very, very illegal in Europe. It is called "cutting the spread", and
carries decade long sentences. 

>Please note that the scenario above doesn't gain society as such 
>anything at all, except in the form of employment for fresh MIT graduates.

-- mrr

[toc] | [prev] | [next] | [standalone]


#1700

FromStephen Fuld <SFuld@alumni.cmu.edu.invalid>
Date2011-05-19 13:31 -0700
Message-ID<ir3unl$81k$1@dont-email.me>
In reply to#1615
On 5/16/2011 6:44 AM, Quadibloc wrote:
> On May 16, 3:05 am, Terje Mathisen<"terje.mathisen at tmsw.no">
> wrote:
>> Quadibloc wrote:
>>> At least people aren't yet using C when they should be using COBOL.
>>> *That* would end up turning it into PL/I.
>>
>> _Nobody_ uses C when they should be using COBOL, but that's simply
>> because nobody should be using COBOL in the first place.
>
> In that case, I misspoke.
>
> Are people using C to write business-oriented accounting and database
> applications?

First, for accounting, that is an area that is so standardized that no 
one writes their own any more.  They use a standardized package for 
GL/AP/AR, etc.  On the other hand, some of those packages, particularly 
the more recently developed ones for Unix and PCs are written in C.

For database applications, there are lots of them written in C, 
especially those to run under Unix or on PCs.  And, of course, the 
underlying database engines such as Oracle or SQL Server are written in C.

> If so, are there alternate languages available which
> they _should_ be using?

That depends, the choice seems more driven by the availability of people 
and better fitting in with existing programs within the company than 
anything else.  BTW, those are the same reasons why many mainframe 
applications are still being developed in COBOL.



-- 
  - Stephen Fuld
(e-mail address disguised to prevent spam)

[toc] | [prev] | [next] | [standalone]


#1619

FromStephen Fuld <SFuld@alumni.cmu.edu.invalid>
Date2011-05-16 09:05 -0700
Message-ID<iqrhvc$efe$1@dont-email.me>
In reply to#1606
On 5/16/2011 2:05 AM, Terje Mathisen wrote:
> Quadibloc wrote:
>> At least people aren't yet using C when they should be using COBOL.
>> *That* would end up turning it into PL/I.
>
> _Nobody_ uses C when they should be using COBOL, but that's simply
> because nobody should be using COBOL in the first place.

Ouch!!

I remember a short article some years ago in, IIRC CACM about the 
features of COBOL that were, at that time unique, that made it very 
suitable for its intended use, business and financial type programs.  I 
think there were three of them.  One was decimal arithmetic (the old 
bugaboo about accountants not liking .33 * 3 = 1).  A second was ease of 
precise formatting of output (both of values by using the picture clause 
floating currency signs, negative numbers optionally in parentheses, 
etc., and of printed reports, paper bills, etc.)  I don't remember the 
third :-(.

While some languages have since adopted some of these features, and, of 
course you can code anything in any language, that doesn't negate the 
point that if you need to do the kind of things that COBOL does easily, 
then it is much easier to do them in COBOL than most other languages, 
certainly including C and FORTRAN.

That having been said, there are certainly a lot of things in COBOL not 
to like, and I am certainly not advocating it for most uses, but saying 
"never use it" seems, to me, too strong.


-- 
  - Stephen Fuld
(e-mail address disguised to prevent spam)

[toc] | [prev] | [next] | [standalone]


#1621

FromTerje Mathisen <"terje.mathisen at tmsw.no">
Date2011-05-16 22:37 +0200
Message-ID<she8a8-phb.ln1@ntp6.tmsw.no>
In reply to#1619
Stephen Fuld wrote:
> On 5/16/2011 2:05 AM, Terje Mathisen wrote:
>> Quadibloc wrote:
>>> At least people aren't yet using C when they should be using COBOL.
>>> *That* would end up turning it into PL/I.
>>
>> _Nobody_ uses C when they should be using COBOL, but that's simply
>> because nobody should be using COBOL in the first place.
>
> Ouch!!
>
> I remember a short article some years ago in, IIRC CACM about the
> features of COBOL that were, at that time unique, that made it very
> suitable for its intended use, business and financial type programs. I
> think there were three of them. One was decimal arithmetic (the old
> bugaboo about accountants not liking .33 * 3 = 1). A second was ease of
> precise formatting of output (both of values by using the picture clause
> floating currency signs, negative numbers optionally in parentheses,
> etc., and of printed reports, paper bills, etc.) I don't remember the
> third :-(.

I wrote what I did because I have once re-implemented a 33 page COBOL 
program, written to do fancy processing (multilayer grouping & sorting) 
on 80-col ascii records, i.e. punch card images, and produce a nice 
result list:

The equivalent Pascal program was 12 pages, even though I had to include 
my own sorting code, card format splitter/reader routines and the output 
report processing.
>
> While some languages have since adopted some of these features, and, of
> course you can code anything in any language, that doesn't negate the
> point that if you need to do the kind of things that COBOL does easily,
> then it is much easier to do them in COBOL than most other languages,
> certainly including C and FORTRAN.
>
> That having been said, there are certainly a lot of things in COBOL not
> to like, and I am certainly not advocating it for most uses, but saying
> "never use it" seems, to me, too strong.

For once, I tried to leave the smiley implied.

It didn't quite work, obviously. :-(

Terje
>
>


-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

[toc] | [prev] | [next] | [standalone]


#1680

FromStephen Fuld <SFuld@alumni.cmu.edu.invalid>
Date2011-05-18 23:16 -0700
Message-ID<ir2ckg$3ic$1@dont-email.me>
In reply to#1621
On 5/16/2011 1:37 PM, Terje Mathisen wrote:
> Stephen Fuld wrote:
>> On 5/16/2011 2:05 AM, Terje Mathisen wrote:
>>> Quadibloc wrote:
>>>> At least people aren't yet using C when they should be using COBOL.
>>>> *That* would end up turning it into PL/I.
>>>
>>> _Nobody_ uses C when they should be using COBOL, but that's simply
>>> because nobody should be using COBOL in the first place.
>>
>> Ouch!!
>>
>> I remember a short article some years ago in, IIRC CACM about the
>> features of COBOL that were, at that time unique, that made it very
>> suitable for its intended use, business and financial type programs. I
>> think there were three of them. One was decimal arithmetic (the old
>> bugaboo about accountants not liking .33 * 3 = 1). A second was ease of
>> precise formatting of output (both of values by using the picture clause
>> floating currency signs, negative numbers optionally in parentheses,
>> etc., and of printed reports, paper bills, etc.) I don't remember the
>> third :-(.
>
> I wrote what I did because I have once re-implemented a 33 page COBOL
> program, written to do fancy processing (multilayer grouping & sorting)
> on 80-col ascii records, i.e. punch card images, and produce a nice
> result list:
>
> The equivalent Pascal program was 12 pages, even though I had to include
> my own sorting code, card format splitter/reader routines and the output
> report processing.

Well, no one ever accused COBOL of concision.  In fact, not only was 
concision not one of COBOL's design goals, the design goals were to 
deliberately eschew concision in favor of the (now obviously) mistaken 
idea that if you made the computer language look more like English, you 
would achieve "self documenting" programs.


>> While some languages have since adopted some of these features, and, of
>> course you can code anything in any language, that doesn't negate the
>> point that if you need to do the kind of things that COBOL does easily,
>> then it is much easier to do them in COBOL than most other languages,
>> certainly including C and FORTRAN.
>>
>> That having been said, there are certainly a lot of things in COBOL not
>> to like, and I am certainly not advocating it for most uses, but saying
>> "never use it" seems, to me, too strong.
>
> For once, I tried to leave the smiley implied.
>
> It didn't quite work, obviously. :-(

Sorry I missed it.  :-(



-- 
  - Stephen Fuld
(e-mail address disguised to prevent spam)

[toc] | [prev] | [next] | [standalone]


#1639

FromChrisQ <meru@devnull.com>
Date2011-05-17 17:10 +0100
Message-ID<x5xAp.1704$Wy2.274@newsfe23.ams2>
In reply to#1619
Stephen Fuld wrote:

> 
> That having been said, there are certainly a lot of things in COBOL not 
> to like, and I am certainly not advocating it for most uses, but saying 
> "never use it" seems, to me, too strong.
> 
> 

It may be too expensive to learn many programming languages now. The
current approach is to learn one general purpose language (ideally to
fluency), then add libraries to handle the corner and specialist areas...

Regards,

Chris

[toc] | [prev] | [next] | [standalone]


Page 5 of 7 — ← Prev page 1 2 3 4 [5] 6 7  Next page →

Back to top | Article view | comp.arch


csiph-web