Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!uwm.edu!bionet!agate!darkstar!saturn.ucsc.edu!sidney From: sidney@saturn.ucsc.edu (Sidney Markowitz ) Newsgroups: comp.lang.c++ Subject: Re: Problems of Zortech C++ v2.1 Message-ID: <5286@darkstar.ucsc.edu> Date: 19 Jul 90 20:29:57 GMT References: <82035@tut.cis.ohio-state.edu> <31714@cup.portal.com> <1331@proto.COM> Sender: usenet@darkstar.ucsc.edu Distribution: na Organization: University of California, Santa Cruz Lines: 22 In article <1331@proto.COM> joe@proto.COM (Joe Huffman) writes: >Okay, first off from page 34 of E & S: "It follows, contrary to popular >misconception, that the safety of any conversion from an integral type >to a floating type is implementation dependent." Reading the previous lines in that paragraph on page 34 reveals that "it follows" from the minimum magnitude values defined in sections 3.2.1 and 3.2.2 which allow an implementation to support integral values with more digits than the precision of some floating type values. So you can have a 10 digit long but only 6 digits of precision in a float and still have a conforming implementation. The very next sentence on page 34 specifies that the implementation dependence is when the integral value is in the range that can be represented as the floating type, but not represented exactly. That means that if you have an integral value that has no more digits than the precision of the floating type, the conversion is absolutely safe. -- sidney markowitz Disclaimer: I guess I should let on when there's any hint of competitor-bashing, that I work for Borland, but I am not officially speaking for Borland.