/usr/share/doc/NTL/conversions.txt is in libntl-dev 5.4.2-4.1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | CONVERSIONS
notation:
typedef unsigned int uint;
typedef unsigned long ulong;
typedef const char * cstr;
destination: source
int: int, long, uint, ulong, ZZ, float, double, xdouble, quad_float, RR
long: int, long, uint, ulong, ZZ, float, double, xdouble, quad_float, RR
float: int, long, uint, ulong, ZZ, float, double, xdouble, quad_float, RR
double: int, long, uint, ulong, ZZ, float, double, xdouble, quad_float, RR
uint: ZZ
ulong: ZZ
xdouble: int, long, uint, ulong, ZZ, float, double, xdouble, RR, cstr
quad_float: int, long, uint, ulong, ZZ, float, double, quad_float, RR, cstr
RR: int, long, uint, ulong, ZZ, float, double, xdouble, quad_float,
RR, cstr
ZZ: int, long, uint, ulong, ZZ, float, double, xdouble, quad_float,
RR, cstr
ZZ_p: long, ZZ
vec_ZZ_p: vec_ZZ
ZZ_pX: long, ZZ_p, ZZ, ZZX, vec_ZZ_p
zz_p: long, ZZ
vec_zz_p: vec_ZZ
ZZ_pX: long, zz_p, ZZ, ZZX, vec_zz_p
vec_ZZ: vec_ZZ_p, vec_zz_p
ZZX: long, ZZ, ZZ_pX, zz_pX
GF2: long, ZZ
vec_GF2: GF2X
GF2X: long, ZZ, GF2, vec_GF2
GF2E: long, ZZ, GF2, GF2X
GF2EX: long, ZZ, GF2, GF2E, GF2X, vec_GF2E
mat_ZZ_p: mat_ZZ
mat_zz_p: mat_ZZ
ZZ_pE: long, ZZ, ZZ_p, ZZ_pX
ZZ_pEX: long, ZZ, ZZ_p, ZZ_pE, ZZ_pX
zz_pE: long, ZZ, zz_p, zz_pX
zz_pEX: long, ZZ, zz_p, zz_pE, zz_pX
********** NOTES ***********
nomenclature:
- integral types: int, long, uint, ulong, ZZ
- bounded integral types: int, long, uint, ulong
- floating point types: float, double, xdouble, quad_float, RR
[1] All conversion operators come in procedural or functional
form. To convert a of type S to x of type T, you can write
conv(x, a);
or
x = to_T(a);
E.g., to_int(a), to_long(a), to_uint(a), to_ulong(a),
to_ZZ(a), to_xdouble(a), to_RR(a).
[2] All conversions from an integral type to a bounded integral type
compute the result modulo 2^n, where n is the number of bits of the
destination type: no overflow occurs.
[3] All floating point to integral conversions compute the floor
function *exactly*, unless the destination type is int or long
and overflow occurs, in which case the behavior is undefined.
[4] The ZZ to double conversion routine is very precise:
the result is the nearest double, breaking ties using the
"round to even" rule. Overflow results in +/- Infinity.
All this assumes the underlying floating point adheres to
the IEEE standard.
[5] All conversions to RR round to the current working precision.
[6] All conversions from long or ZZ to one of the "mod p" types
ZZ_p, ZZ_pX, ZZ_pE, ZZ_pEX,
zz_p, zz_pX, zz_pE, zz_pEX,
GF2, GF2X, GF2E, GF2EX
yield the the residue class modulo p.
[7] All polynomial to polynomial conversions apply coefficient-wise
conversion.
[8] All vector/matrix to vector/matrix conversions apply element-wise
conversion.
[9] The GF2X/ZZ_pX/zz_pX to GF2E/ZZ_pE/zz_pE conversions reduce
the given polynomial modulo the current modulus.
[10] All conversions from the type cstr apply the same algorithm
as is used for reading from an I/O stream, so
ZZ x = to_ZZ("999999999999999999");
initializes the ZZ x to the integer 999999999999999999.
[11] The conversions to vec_ZZ from vec_ZZ_p and vec_zz_p copy the
standard non-negative residues; likewise for the conversions
to ZZX from ZZ_pX and zz_pX.
|