Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!think.com!paperboy!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Here's a challenge for floating point lovers. Message-ID: <14938@smoke.brl.mil> Date: 23 Jan 91 22:36:10 GMT References: <1991Jan21.215629.8393@watdragon.waterloo.edu> <1991Jan22.180927.29232@zoo.toronto.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 14 In article <1991Jan22.180927.29232@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >>Does ANSI X3.159 require the ability to define such a constant? >No. Nobody's come up with a good way of doing this that I know of, >especially when portability is desired. Presumably portability is not an issue for this application. What some implementors do is to initialize what amounts to a union type with the proper bits then refer to the floating-point member of that union to get the value interpreted properly with the proper floating type. The standard does NOT require that the values of the macros be CONSTANT expressions; in particular they may access external storage at run time (contents of such a union, for example). Note also that this means that FLT_RADIX and other macros must not be used in #if expressions in strictly conforming programs.