[fpc-devel] Math and numlib

Michael Van Canneyt michael at freepascal.org
Tue Mar 14 09:27:51 CET 2017



On Mon, 13 Mar 2017, Werner Pamler wrote:

> Hi everybody - my first post here...
>
> At the moment I am spending some time with fpc's numlib and writing a 
> wrapper for a more versatile fitting procedure. Are there any problems 
> to add the unit math to the uses clause of some numlib units? I want to 
> use the value NaN (not-a-number) which is defined in numlib, but there 
> is no way to check whether a value is "equal" to NaN. In math, however, 
> there is a function IsNaN(). And my feeling is that these special 
> numbers NaN and Infinity are implemented in math in a more general way 
> than in numlib. An idea would be to remove NaN and Infinity from the 
> numlib unit "typ" to replace them by the math values.

You can use the routines from the system unit for this.

http://www.freepascal.org/docs-html-3.0.0/rtl/system/textended80rec.html
http://www.freepascal.org/docs-html-3.0.0/rtl/system/tdoublerec.html
http://www.freepascal.org/docs-html-3.0.0/rtl/system/tsinglerec.html

function SpecialType.

Michael.



More information about the fpc-devel mailing list