[fpc-devel] Math and numlib

Michael Van Canneyt michael at freepascal.org
Tue Mar 14 11:27:24 CET 2017



On Tue, 14 Mar 2017, Werner Pamler wrote:

> Thanks - unfortunately I've just uploaded a patch for unit typ 
> implementing IsNaN and IsInfinity according to Michael's suggestion. But 
> I think I'll withdraw the patch and replace it with one for a cleaned up 
> typ unit.
>
> How about cleaning up also spe? It contains a large number of functions 
> which are contained in math as well, but with a terrible name (e.g., 
> "spesih(x)" instead of "sinh(x)"). In theory, of course, this will break 
> existing code although I am absolutely sure that nobody ever has used 
> these functions.
>
> Another idea: Errors in spe (and probably everywhere else) terminate the 
> program with a RunError. This is not up to date any more. How about 
> throwing an exception? Or, maybe, I could add a procedure 
> "NumLibError(ErrCode: Integer)" which by default throws an exception 
> with a message corresponding to the ErrCode, or, if compiled with 
> $DEFINE RUNTIME_ERRORS, terminates the program like before with a 
> RunError(ErrCode).

Better make this a normal variable; not a define.

Michael.



More information about the fpc-devel mailing list