Math Libraries
241
11
If your
matherr()
function returns a non-zero result, no exception message is
printed, and
errno
is not set.
DOMAIN
Argument domain exception
SING
Argument singularity
OVERFLOW
Overflow range exception
UNDERFLOW
Underflow range exception
TLOSS
Total loss of significance
PLOSS
Partial loss of significance
program TestMatherr(output);
#include <math_p.h>
function matherr(var info: exception): integer;
begin
case info.kind of
DOMAIN: begin
{ change sqrt to return sqrt(-arg1), not NaN }
if substr(info.name^, 1, length('sqrt')) = 'sqrt' then begin
info.retval := sqrt(-info.arg1);
matherr := 1; { No exception message will be printed }
end;
end;
otherwise
matherr := 0;
end;
end;
begin
writeln('Error handling function');
writeln('sqrt(-1)= ', sqrt(-1));
end.
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......