Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

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

Re: why still use C?



On 21 Nov 2003 23:48:45 GMT in comp.lang.c.moderated, "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. 

>A pragma which could be used
>inside a program would be especially dangerous (consider the
>base being switched inside an #include).

Nooooooooo!

>The entire existing base
>of binary FP functions could not be used from a program which
>selected base 10.

Current IBM 390/z compilers and platforms don't appear to support any
mixing of binary and hex FP instructions and functions in the same
code -- Linux supports IEEE functions and requires IEEE instructions
-- native OSes support hex functions and require hex instructions.  

I think the FP functions can be adequately handled by the tgmath.h
(generic math function names) additions, with the extra effort to
develop decimal FP functions borne solely on platforms where that is a
compiler option. 

Modules either have an explicit radix dependency or not -- those with
require special coding or compile options -- those without either
don't care, or have to take precautions assuming the worst case --
typically the minimum limits documented for float.h. 
-- 
Thanks. Take care, Brian Inglis         Calgary, Alberta, Canada

[EMAIL PROTECTED]       (Brian dot Inglis at SystematicSw dot ab dot ca)
    fake address                use address above to reply
-- 
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.