🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4595

Re: sizeof(1L) in preprocesor;How to tell sizeof(double)>sizeof(long) ?

#4595
From: Nick Maclaren
Date: Tue, 09 Jan 1996 13:13
32 lines
2242 bytes
In article <KANZE.96Jan9135752@slsvewt.lts.sel.alcatel.de>, kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) writes:
|> In article <4ctk66$57j@lyra.csx.cam.ac.uk> nmm1@cus.cam.ac.uk (Nick
|> Maclaren) writes:
|> 
|> |> Don't bother - the 'constants' in <float.h> aren't!  This is a specific
|> |> exclusion to make life easier for systems with separate floating-point
|> |> processors, and makes <float.h> almost useless for numerical analysts.
|> 
|> |> I tried to get this imbecility (and it IS an imbecility) fixed, but I
|> |> failed.  So any portable library of mathematical functions has to define
|> |> its own system-dependent constants, and can use <float.h> only for
|> |> comparison :-(
|> 
|> Is this true for all of the ``constants'' in float.h, or only some of
|> them?  I don't have my C standard here to check, but I thought that
|> this was only true of the constants whose type was non-integral.

All except FLT_RADIX.  The reason for this is probably that Intel and
similar chips work in only one radix, but most other properties can be
set dynamically.  However, there is no fundamental reason why FLT_RADIX
should be fixed or, indeed, the same for all precisions.

Incidentally, I don't know of any systems which actually USE dynamic
values - all of the ones that I have tried used fixed values in <float.h>
even though they don't all use preprocessor constants for all values.


Nick Maclaren,
University of Cambridge Computer Laboratory,
New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.
Email:  nmm1@cam.ac.uk
Tel.:  +44 1223 334761    Fax:  +44 1223 334679
Technical Details
Message-ID: <4ctpkv$82v@lyra.csx.cam.ac.uk>
Path: arc1-ca.pugleaf.net!lyra.csx.cam.ac.uk!nmm1
References: <sc3f9vb6gk.fsf@lns101.lns.cornell.edu> <1996Jan5.094122.16151@sq.com> <vyzd98ug7w4.fsf@lamothe.informatik.uni-dortmund.de> <tuent98zl4.fsf@nemo.bedford.waii.com> <4ctk66$57j@lyra.csx.cam.ac.uk> <KANZE.96Jan9135752@slsvewt.lts.sel.alcatel.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!lyra.csx.cam.ac.uk!nmm1
From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.std.c
Subject: Re: sizeof(1L) in preprocesor;How to tell sizeof(double)>sizeof(long) ?
Date: 9 Jan 1996 13:13:03 GMT
Organization: University of Cambridge, England
Message-ID: <4ctpkv$82v@lyra.csx.cam.ac.uk>
References: <sc3f9vb6gk.fsf@lns101.lns.cornell.edu> <1996Jan5.094122.16151@sq.com>  <vyzd98ug7w4.fsf@lamothe.informatik.uni-dortmund.de>  <tuent98zl4.fsf@nemo.bedford.waii.com> <4ctk66$57j@lyra.csx.cam.ac.uk> <KANZE.96Jan9135752@slsvewt.lts.sel.alcatel.de>
NNTP-Posting-Host: ursa.cus.cam.ac.uk