[fpc-pascal] real numbers infinity
public at szutils.net
Tue Apr 11 07:37:07 CEST 2006
> when a real number overflows the program halts with EInvalidOp error.
> How can I make the program behave the more standard way, where the
> variable gets the value "inf" and execution continues normally? This is
> vital for many tasks, like fractal computation.
You can use try..except..end block and switch -Sd when compile:
while True do
Or you may take a look IEEE specification if it is necessary to create your
own big float support for larger precision with fractals.
> P.S. Why when the program doesn't include the variants unit the program
> complains at runtime? What is that unit?
At windows, it is not necessary for this example. Variants unit provide new
type definition and supported functions, which can consist any simple type
(integer, string, etc).
More information about the fpc-pascal