Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: why still use C?



Brian Inglis wrote:
"Mike Cowlishaw" <[EMAIL PROTECTED]> wrote:
Morris Dovey wrote:
Never wanting to miss an opportunity to display my considerable
ignorance, why not leave selection of floating point radix a
compile/link option? I've been thinking back over all the
financial code I've ever written/seen and can't think of any
instance where use of more than a single floating point radix
made any sense at all. Why not simply use the type names we
already have?

This would mean that one could never have both binary and decimal FP data in the same program/structure.

This is a very good idea -- mixing binary, decimal (and hex) FP formats in a structure or a set of related modules is a very bad
idea -- unless the radix can be detected at the hardware level.

Well, to cite one place where both decimal and binary arithmetic will have to be supported concurrently, think of the major DBMS.


They typically support a FLOAT type that is based on a C-style binary double type, and they also typically support a DECIMAL type that is based on a (proprietary) software decimal floating point package. When hardware decimal types are provided, backwards compatibility requirements (a very heavy chain shackling the legs of those who have to implement the DBMS) will require the existing code - both binary and decimal - to continue to work as now, warts and all, while new data types are added to work with the new standard IEEE 754R decimal data types. Fun will be had determining the rules of mixed mode arithmetic. For backwards compatibility, existing code will continue to work unchanged, but new code using new expressions and the new types will use the new decimal arithmetic. (That means, amongst other things, that we may need a new notation to write a new-style decimal literal value, though there's a chance that the existing rules can be adapted to suit - such as the constant is DECIMAL unless one of the other operands is a new-style decimal type.)

I doubt that DBMS will be the only such programs - spreadsheets might be another, for example (though maybe not; who knows?). Scripting languages such as Perl migh be another example - or maybe not. Such specialized programs are likely to be in the minority, but it will not be a negligible minority.

--
Jonathan Leffler                   #include <disclaimer.h>
Email: [EMAIL PROTECTED], [EMAIL PROTECTED]
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
--
comp.lang.c.moderated - moderation address: [EMAIL PROTECTED]



<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.