in reply to Re: Infinity and platforms
in thread Infinity and platforms

Is there an overview somewhere of the possible variants of infinity? I want to test functions that are expected to return infinity, independently of architectures, compilers and libraries.
--
Andreas

Replies are listed 'Best First'.
Re^3: Infinity and platforms
by ysth (Canon) on Jan 18, 2008 at 09:28 UTC
    SUSv3 says "infinity shall be converted in one of the styles "[-]inf" or "[-]infinity" ; which style is implementation-defined." Unfortunately, MS can't change their broken, made up garbage without breaking their compatibility with folk who have coded to it. I'm rather surprised that Solaris is broken, though.
Re^3: Infinity and platforms
by swampyankee (Parson) on Jan 18, 2008 at 22:31 UTC

    You could check the standards document for C, and cross-check the IEEE arithmetic standard, which I think is IEEE 754.

    This could work, especially if you can be reasonably sure that the C-compiler being used is actually standards-compliant, and the standard doesn't say something like "it's up to the compiler builder," which it almost certainly does, so the likely short answer to your question is "No." You may (probably will) have to take this up with members of the numerical analysis community, where they deal with this sort of issue all the time.


    emc

    Information about American English usage here and here.

    Any Northeastern US area jobs? I'm currently unemployed.