source: git/ntl/src/GF2.c @ 6ce030f

spielwiese
Last change on this file since 6ce030f was 287cc8, checked in by Hans Schönemann <hannes@…>, 14 years ago
ntl 5.5.2 git-svn-id: file:///usr/local/Singular/svn/trunk@12402 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 610 bytes
Line 
1
2#include <NTL/GF2.h>
3
4#include <NTL/new.h>
5
6NTL_START_IMPL
7
8
9void div(GF2& x, GF2 a, GF2 b)
10{
11   if (b == 0) Error("GF2: division by zero");
12   x = a;
13}
14
15void div(GF2& x, long a, GF2 b)
16{
17   if (b == 0) Error("GF2: division by zero");
18   x = a;
19}
20
21void div(GF2& x, GF2 a, long b)
22{
23   if ((b & 1) == 0) Error("GF2: division by zero");
24   x = a;
25}
26
27void inv(GF2& x, GF2 a)
28{
29   if (a == 0) Error("GF2: division by zero");
30   x = a;
31}
32
33void power(GF2& x, GF2 a, long e)
34{
35   if (e == 0) {
36      x = 1;
37      return;
38   }
39
40   if (e < 0 && a == 0)
41      Error("GF2: division by zero");
42
43   x = a;
44}
45
46NTL_END_IMPL
Note: See TracBrowser for help on using the repository browser.