HP SunSoft Pascal 4.0 Uživatelský manuál Strana 267

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 333
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 266
Math Libraries 243
11
The syntax of this function is described in the ieee_flags(3M) man page.
If an exception is raised at any time during program execution, then its flag is
set, unless it is explicitly cleared. Clearing accrued exceptions is done by a call,
as shown in the following Pascal program.
program TestIEEEFlags(output);
#include "math_p.h"
var
FlAction, FlMode, FlIn: string;
FlOut: string_pointer;
Zero: integer := 0;
begin
writeln(sqr(-1)); { Invalid operation }
writeln(1 / Zero); { Division by zero }
writeln(exp(709.8)); { Overflow }
writeln(exp(-708.5)); { Underflow }
writeln(log(1.1)); { Inexact }
FlAction := 'clear';
FlMode := 'exception';
FlIn := 'all';
writeln(ieee_flags(FlAction, FlMode, FlIn, FlOut));
end.
Zobrazit stránku 266
1 2 ... 262 263 264 265 266 267 268 269 270 271 272 ... 332 333

Komentáře k této Příručce

Žádné komentáře