Some questions about floatting point issues

From: jean-marc alliot (alliot@recherche.enac.fr)
Date: Tue Feb 22 2000 - 12:15:53 MET

  • Next message: Xavier Leroy: "Re: [Q] About Unix Library of Ocaml"

    Hi,

    We have developped an interval programming library in ML. We use it
    mainly for branch and bound optimization.

    The problem is that, to write a correct interval library, you have to
    use some processor specific features regarding rounding mode (you have
    to turn it to rounding towards minus infinity when computing lower
    bounds, towards plus infinity when computing upper bound, etc).

    I wrote the assembly language routines to do the trick, but I have a few
    questions:
    1) What is the default mode turned on by ocaml (I suppose it is rounding
    towards nearest?)
    2) Is this mode often reinforced (before each floatting point operation)
    or is it only set once?
    3) Is it possible to tell ocamlopt to inline a few lines of assembly
    code? Changing the FPU mode is very fast (two "mov", one "and" and one
    "or") and it is a pity to suffer the overhead of one function call each
    time.

    Thanks

    Jean-Marc Alliot



    This archive was generated by hypermail 2b29 : Tue Feb 22 2000 - 15:09:02 MET