Re: Identifying an exact binary representation



Bernhard Enders wrote:
(snip)

It would be nice to have the fp number as a string and then check if
it is possible to represent it exactly in binary, but maybe, for
simplicity, it is not necessary to represent it as a string, maybe it
is possible to investigate the actual binary representation to check
is it was rounded according to IEEE-754 standard or something. I was
primary thinking of some logical function such that isExact(0.25)
returns true and isExact(0.1) returns false. Thanks,

I think that would be isExact('0.25') and isExact('0.1')

On machines with float decimal arithmetic it should return the
appropriate value for that?

-- glen

.



Relevant Pages

  • Re: The Philosophy of Programming?
    ... less trivial to ensure that the string length has not been altered. ... > lowers psychological complexity for most intelligent readers. ... For most intelligent programmers, the laziness principal applies. ...
    (comp.programming)
  • Re: A C++ Whishlist
    ... > people from inclusion in a standard. ... > creating their own string class. ... >>don't want an ever increasing size of exception specification on each ...
    (comp.lang.cpp)
  • Re: Hash functions (was: Maximum String size in Java?)
    ... snip ... ... Inserted with sx31hsh and ssfh_ph in 0.385 secs ... your string library has problems with them speaks for itself. ... published your SFH code with the shifted and undersized ints. ...
    (comp.programming)
  • Re: Zero terminated strings
    ... including when you do things like string concatenation etc ... Simple "tricks" are all you need to implement a decent link level ... <snip basic link layer protocol> ...
    (comp.lang.c)
  • Performance with reading large numbers of files...
    ... I have a small test application that recurses a directory and adds all the file names to a string collection. ... RecurseDirs, sDiskFiles); ... private static void RecurseDirs ...
    (microsoft.public.dotnet.framework.performance)