The dangers of "Trunc"

From: Bram (spamdustbin_at_yahoo.com)
Date: 02/24/05

  • Next message: alanglloyd_at_aol.com: "Re: The dangers of "Trunc""
    Date: 24 Feb 2005 05:16:58 -0800
    
    

    I recently stumbled over something interesting. When your application works
    with calls to external APIs that process blocks of reals you have to set the
    coprocessor's controlword using Set8087CW(NewCW: Word) in order to
    prevent seemingly random EInvalidOp exceptions. For example, you'd do this
    when working with OpenGL libraries.

    However, some of Delphi's standard functions reset the coprocessor's
    controlword, unadvertently reintroducing the EInvalidOp problem. One
    of these functions is "Trunc". Does anyone know of other Delphi functions
    causing the FPU to reset its controlword?

    Thanks!

    Bram


  • Next message: alanglloyd_at_aol.com: "Re: The dangers of "Trunc""