Code Comments
Programming Forum and web based access to our favorite programming groups.From an ISO draft technical document: ----- ISO/IEC JTC1 SC22 WG14 N1176 Date: 2006-05-24 Reference number of document: ISO/IEC WDTR 24732 Committee identification: ISO/IEC JTC1 SC22 WG14 SC22 Secretariat: ANSI Information Technology - Programming languages, their environments and system software interfaces - Extension for the programming language C to support decimal floating-point arithmetic - --- Even though the hardware may not provide decimal arithmetic operations, the support can still be emulated by software. Programming languages used for business applications either have native decimal types (such as PL/I, COBOL, C#, or Visual Basic) or provide decimal arithmetic libraries (such as the BigDecimal class in Java). The arithmetic used, nowadays, is almost invariably decimal floating-point; the COBOL 2002 ISO standard, for example, requires that all standard decimal arithmetic calculations use 32-digit decimal floating-point. -----
Post Follow-up to this messageOn 11/05/07 11:02 am, Rick Smith wrote: > From an ISO draft technical document: > ----- > ISO/IEC JTC1 SC22 WG14 N1176 > Date: 2006-05-24 > Reference number of document: ISO/IEC WDTR 24732 > Committee identification: ISO/IEC JTC1 SC22 WG14 > SC22 Secretariat: ANSI > Information Technology - > Programming languages, their environments and system software interfaces - > Extension for the programming language C to support decimal floating-point > arithmetic - > --- > Even though the hardware may not provide decimal arithmetic > operations, the support can still be emulated by software. > Programming languages used for business applications either > have native decimal types (such as PL/I, COBOL, C#, or > Visual Basic) or provide decimal arithmetic libraries (such as > the BigDecimal class in Java). The arithmetic used, nowadays, > is almost invariably decimal floating-point; the COBOL 2002 > ISO standard, for example, requires that all standard decimal > arithmetic calculations use 32-digit decimal floating-point. I don't intend to get into a debate about the pros/cons of various internal representations of data, nor how they are processed in the languages. The following is simply to state a few facts that expands on the above: 1) IBM System z [mainframe systems] do have hardware implementation of decimal float. 2) Support for the hardware in #1 is provided for programs written in [in alphabetical order]: a) Assembler Language b) C/C++ c) PL/I d) The SHARE User Group has requested support for COBOL, but IBM has not yet responded to the requirement. Carl
Post Follow-up to this messageOn Mon, 05 Nov 2007 13:08:21 -0500, CG <Carl.Gehr.ButNoSPAMStuff5@MCGCG.Com> wrote: >On 11/05/07 11:02 am, Rick Smith wrote: > >I don't intend to get into a debate about the pros/cons of various >internal representations of data, nor how they are processed in the >languages. The following is simply to state a few facts that expands on >the above: >1) IBM System z [mainframe systems] do have hardware implementation of >decimal float. >2) Support for the hardware in #1 is provided for programs written in >[in alphabetical order]: > a) Assembler Language > b) C/C++ > c) PL/I > d) The SHARE User Group has requested support for COBOL, > but IBM has not yet responded to the requirement. Does IBM's action on this and other requirements tell everybody whether IBM corporate really thinks COBOL has a future? On another forum Tom Ross has said there are changes coming but I fear they are years too late. > >Carl
Post Follow-up to this messageOn Nov 5, 4:02 pm, "Rick Smith" <ricksm...@mfi.net> wrote: > From an ISO draft technical document: > ----- > ISO/IEC JTC1 SC22 WG14 N1176 > Date: 2006-05-24 > Reference number of document: ISO/IEC WDTR 24732 > Committee identification: ISO/IEC JTC1 SC22 WG14 > SC22 Secretariat: ANSI > Information Technology - > Programming languages, their environments and system software interfaces - > Extension for the programming language C to support decimal floating-point > arithmetic - > --- > Even though the hardware may not provide decimal arithmetic > operations, the support can still be emulated by software. > Programming languages used for business applications either > have native decimal types (such as PL/I, COBOL, C#, or > Visual Basic) or provide decimal arithmetic libraries (such as > the BigDecimal class in Java). The arithmetic used, nowadays, > is almost invariably decimal floating-point; the COBOL 2002 > ISO standard, for example, requires that all standard decimal > arithmetic calculations use 32-digit decimal floating-point. > ----- The COBOL 2002 version of standard arithmetic is being superceded by two IEEE754r compliant forms called standard binary arithmetic and standard decimal arithmetic. The new IEEE754r is still in draft, but now seems fairly stable, at least in so far as J4 COBOL plans to implement it. As I understand it from J4 dccuments, no one has yet implemented the standard ariihmetic of the 2002 COBOL standard and, in view of the forthcoming changes, it is extremely unlikely that any will. Whether or not they implement the new forms remains to be seen, I believe that IEEE754r recommends that at least standard decimal arithmetic be implemented by programming languages. As a practical expedient, COBOL will diverge slightly from full compliance from IEEE754r. The default rounding form for the new types of standard arithmetic will still be done in the traditional COBOL manner, presumably and reasonably for backward compatibility. Programmers can still get effective compliance with IEEE754r by explicitly defining the rounding mode.
Post Follow-up to this message"Robert Jones" <rjones0@hotmail.com> wrote in message news:1194781359.463558.183080@v2g2000hsf.googlegroups.com... > On Nov 5, 4:02 pm, "Rick Smith" <ricksm...@mfi.net> wrote: interfaces - floating-point > > The COBOL 2002 version of standard arithmetic is being superceded by > two IEEE754r compliant forms called standard binary arithmetic and > standard decimal arithmetic. The new IEEE754r is still in draft, but > now seems fairly stable, at least in so far as J4 COBOL plans to > implement it. As I understand it from J4 dccuments, no one has yet > implemented the standard ariihmetic of the 2002 COBOL standard and, in > view of the forthcoming changes, it is extremely unlikely that any > will. Whether or not they implement the new forms remains to be seen, > I believe that IEEE754r recommends that at least standard decimal > arithmetic be implemented by programming languages. Yes, all true, as I understand it; but did you at least smile, knowing that part of the rationale for extending the C standard was something from the COBOL standard that is effectively dead! [I posted the quote from the C technical report as an inside joke for those familar with the activities regarding the COBOL standard. <g>]
Post Follow-up to this messageOn Nov 11, 1:39 pm, "Rick Smith" <ricksm...@mfi.net> wrote: > "Robert Jones" <rjon...@hotmail.com> wrote in message > > news:1194781359.463558.183080@v2g2000hsf.googlegroups.com... > > > > interfaces - > floating-point > > > Yes, all true, as I understand it; but did you at least smile, > knowing that part of the rationale for extending the C standard > was something from the COBOL standard that is effectively dead! > > [I posted the quote from the C technical report as an inside > joke for those familar with the activities regarding the COBOL > standard. <g>] Yes I agree, I think (and hope) all programming languages tend to adopt useful features from other languages.
Post Follow-up to this message"Clark F Morris" <cfmpublic@ns.sympatico.ca> wrote in message news:5akcj3t2umrpdv949h4m96nosnq0cli31r@ 4ax.com... > On Mon, 05 Nov 2007 13:08:21 -0500, CG > <Carl.Gehr.ButNoSPAMStuff5@MCGCG.Com> wrote: > > > Does IBM's action on this and other requirements tell everybody > whether IBM corporate really thinks COBOL has a future? On another > forum Tom Ross has said there are changes coming but I fear they are > years too late. I think IBM's current view of COBOL's future is called Java.
Post Follow-up to this message"Rick Smith" <ricksmith@mfi.net> wrote in message news:13je1inhintak13@corp.supernews.com... > > "Robert Jones" <rjones0@hotmail.com> wrote in message > news:1194781359.463558.183080@v2g2000hsf.googlegroups.com... > interfaces - > floating-point > > Yes, all true, as I understand it; but did you at least smile, > knowing that part of the rationale for extending the C standard > was something from the COBOL standard that is effectively dead! > > [I posted the quote from the C technical report as an inside > joke for those familar with the activities regarding the COBOL > standard. <g>] > > I f they really want to improve C they should add an EVALUATE statement.
Post Follow-up to this message"Charles Hottel" <chottel@earthlink.net> wrote: > > I f they really want to improve C they should add an EVALUATE statement. AFAIK, C has always had the 'switch' statement, Pascal has the 'case' statement, modern BASICs have the SELECT statement, etc., all of which predated EVALUATE, and from which I suspect EVALUATE was taken. Unlike the other languages, C's 'switch' statement 'drops through' successiv e 'case' phrases. EVALUATE is more powerful (flexible) than the others; perhaps that was what you meant. :-) -- Judson McClendon judmc@sunvaley0.com (remove zero) Sun Valley Systems http://sunvaley.com "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
Post Follow-up to this messageCharles Hottel wrote:
> I f they really want to improve C they should add an EVALUATE statement.
As Judson said, you do have switch(). But, I've really missed the
EVALUATE TRUE form of the verb. In C (or Java, my current project), you
can't say
switch (true) {
case a = b:
doSomethingCool();
}
Add this to the restriction that you can't switch on a string, and I
really have little to no use for the Java switch statement at all. :(
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ / \/ _ o ~ Live from Albuquerque, NM! ~
~ _ /\ | ~ ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ Business E-mail ~ daniel @ "Business Website" below ~
~ Business Website ~ http://www.djs-consulting.com ~
~ Tech Blog ~ http://www.djs-consulting.com/linux/blog ~
~ Personal E-mail ~ "Personal Blog" as e-mail address ~
~ Personal Blog ~ http://daniel.summershome.org ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~
GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ !O M--
V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e h---- r+++ z++++
"Who is more irrational? A man who believes in a God he doesn't see,
or a man who's offended by a God he doesn't believe in?" - Brad Stine
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.