Name
$SafeDivide Compiler Directive
Syntax
{$U-} // default
{$SafeDivide Off} // default
{$U+}
{$SafeDivide On}Scope
Local
Description
When
you enable the $SafeDivide
directive, Delphi ensures that the
infamous Pentium FDIV bug does not bite your program. With the
$SafeDivide directive, floating-point division is
carried out by a special function. The first time your program calls
the function, it tests for the presence of the bug. If the
floating-point hardware is defective, subsequent divisions are
carried out by software. If the hardware is correct, subsequent
divisions are carried out by the hardware. The test subroutine sets
the TestFDIV variable to -1 if the hardware is
defective or 1 if the hardware is correct.
The FDIV error affects only older Pentium processors and only certain division operations. Most programs can safely ignore this problem today.
See Also
| TestFDIV Variable |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access