Skip to content

Important, Undocumented Delphi 8 Compiler Directive

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:

{$IFNOPT C+}{$FINITEFLOAT OFF}{$ENDIF}

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

Post a Comment

Your email is never published nor shared. Required fields are marked *

Bad Behavior has blocked 1846 access attempts in the last 7 days.

Close