HP SunSoft Pascal 4.0 Instrukcja Użytkownika Strona 263

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 333
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 262
Math Libraries 239
11
Arithmetic Exceptions
An arithmetic exception arises when an attempted atomic arithmetic operation
does not produce an acceptable result. The meaning of the terms “atomic” and
“acceptable” may vary, depending on the context.
Following are the five types of IEEE floating-point exceptions:
Invalid operation—An operand is invalid for the operation about to be
performed.
program TestRandom(output);
#include "math_p.h"
var
n: integer := 100;
i: integer;
ilb, { Lower bound }
iub: integer; { Upper bound }
ia: array [1..100] of integer;
begin
writeln('Integer linear congruential random number generator');
ilb := I_LCRAN_LB;
iub := I_LCRAN_UB;
i_lcrans_(ia, n, ilb, iub);
for i := 1 to n do
writeln(ia[i]);
writeln('Integer additive random number generator');
ilb := minint;
iub := maxint;
i_addrans_(ia, n, ilb, iub);
for i := 1 to n do
writeln(ia[i]);
writeln('Integer random number shufflers');
i_shufrans_(ia, n, ilb, iub);
for i := 1 to n do
writeln(ia[i]);
end.
Przeglądanie stron 262
1 2 ... 258 259 260 261 262 263 264 265 266 267 268 ... 332 333

Komentarze do niniejszej Instrukcji

Brak uwag