Important, Undocumented Delphi 8 Compiler Directive

Posted by on in Blogs

We've discussed this on the Delphi newsgroups, but it bears repitition: There is a very important new compiler directive in Delphi 8 called FINITEFLOAT. This directive, by default, preserves old (D1-D7) behavior with regards to floating point calculations, but introduces a performance cost relative to other .NET applications. If your code is well written and doesn't depend on exceptions to detect attempts to divide by zero (etc.) then consider changing this default.

Here's another hint: You can turn this on for testing purposes, but turn it off for releases. Try this code:


This way the checks will only be done when assertions are enabled.

Tags: .NET Delphi


Check out more tips and tricks in this development video: