This file is indexed.

/usr/include/fplll/nr/nr_FP.inl is in libfplll-dev 5.0.3-1.

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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
/*********************
 *   Float Class
 *********************/

#include "../defs.h"

#ifndef FPLLL_NR_FP_H
#define FPLLL_NR_FP_H

FPLLL_BEGIN_NAMESPACE

/* declaration Z_NR */
template <class F> class Z_NR;

/**
 * FP_NR stores floating-point numbers. This template provides a uniform
 * interface for doing floating-point computations with several underlying
 * types (double, dpe_t and mpfr_t). For all functions, the rounding
 * mode rnd is ignored unless F=mpfr_t.
 */
template <class F> class FP_NR
{

  F data;

public:
  /**
   * Constructors.
   */
  inline FP_NR<F>();
  inline FP_NR<F>(const FP_NR<F> &f);
  inline ~FP_NR<F>();
  inline FP_NR<F>(const double d) : FP_NR<F>() {*this = d;};
  inline FP_NR<F>(const char *s) : FP_NR<F>() {*this = s;};

  /**
   * Returns the current precision for new FP_NR&lt;F&gt; objects.
   */
  static inline unsigned int get_prec();

  /**
   * Sets the precision of new FP_NR&lt;F&gt; objects. Returns the
   # previous value. This has no effect is F != mpfr_t.
   */
  static inline unsigned int set_prec(unsigned int prec);

  /** get data */

  /**
   * Returns the internal representation of the data.
   */
  inline F &get_data() { return data; }

  /**
   * Returns the internal representation of the data.
   */
  inline const F &get_data() const { return data; }

  /**
   * Converts this object to a double. If it does not fit in a double,
   * the result is undefined.
   */
  inline double get_d(mp_rnd_t rnd = GMP_RNDN) const;

  /**
   * Convert this object to a mpfr_t r.
   */
  inline void get_mpfr(mpfr_t r, mp_rnd_t rnd = GMP_RNDN) const;

  /**
   * Convert this object from a mpfr_t r.
   */
  inline void set_mpfr(mpfr_t r, mp_rnd_t rnd = GMP_RNDN);

  /**
   * Converts this object to a long. The rounding direction is undefined.
   * If it does not fit in a long, the result is undefined.
   */
  inline long get_si() const;

  /**
   * Returns expo such value 2^(expo-1) <= value < 2^expo
   *  (expo = floor(abs(log2(abs(value)))) + 1).
   * The return value is undefined if *this == 0.
   */
  inline long exponent() const;

  /**
   * Returns x and defines expo such that
   *  trunc(value * 2^expo_add) ~= x * 2^expo
   * The '~=' is an equality if trunc(value * 2^expo_add) <= LONG_MAX.
   * expo is the minimum non-negative value such that x <= LONG_MAX.
   * expo_add must be 0 if T=dpe_t or T=mpfr_t.
   */
  inline long get_si_exp_we(long &expo, long expo_add) const;

  /**
   * Returns x and defines expo such that trunc(value) ~= x * 2^expo.
   * The '~=' is an equality if trunc(value) <= LONG_MAX.
   * expo is the minimum non-negative value such that |x| <= LONG_MAX.
   * (x is the largest among all possible |x| <= LONG_MAX).
   */
  inline long get_si_exp(long &expo) const;

  /**
   * Computes a and expo such that trunc(value) ~= a * 2^expo.
   *  The '~=' is an equality if Z=mpz_t. expo is always non-negative.
   *  Note that expo might be very close to LONG_MAX when value = 0.
   *  (in nr_FP_misc.h)
   */
  template <class Z> inline void get_z_exp(Z_NR<Z> &a, long &expo) const;

  /**
   * Computes a and expo such that trunc(value) * 2^expo_add ~= a * 2^expo.
   * The '~=' is an equality if Z=mpz_t. expo is always non-negative.
   * expo_add must be 0 if T=dpe_t or T=mpfr_t.
   *  (in nr_FP_misc.h)
   */
  template <class Z> inline void get_z_exp_we(Z_NR<Z> &a, long &expo, long expo_add) const;

  /** set data */

  /**
   * Sets the value to z.
   * (in nr_FP_misc.h)
   */
  template <class Z> inline void set_z(const Z_NR<Z> &z, mp_rnd_t rnd = GMP_RNDN);

  /** comparison */

  /**
   * 3-way comparison. Returns a positive number if *this > b,
   * a negative number if *this < b or zero is *this == b.
   */
  inline int cmp(const FP_NR<F> &b) const;

  /**
   * 3-way comparison. Returns a positive number if *this > d,
   * a negative number if *this < d or zero is *this == d.
   */
  inline int cmp(double d) const;

  /**
   * Sign. Returns a positive number, a negative number or zero if the
   * value of this object is respectively positive, negative or null.
   */
  inline int sgn() const;

  /**
   * Operator
   */
  inline void operator=(const FP_NR<F> &a);
  inline void operator=(const char *s);
  inline void operator=(double a);
  // inline void operator=(mpfr_t& a);
  inline void operator=(mpfr_t &a) { set_mpfr(a, MPFR_RNDN); };
  inline bool operator<(const FP_NR<F> &a) const;
  inline bool operator<(double a) const;
  inline bool operator>(const FP_NR<F> &a) const;
  inline bool operator>(double a) const;
  inline bool operator<=(const FP_NR<F> &a) const;
  inline bool operator<=(double a) const;
  inline bool operator>=(const FP_NR<F> &a) const;
  inline bool operator>=(double a) const;

  inline FP_NR<F> &operator+=(const FP_NR<F> &a) { this->add(*this, a); return *this;};
  inline FP_NR<F> &operator-=(const FP_NR<F> &a) { this->sub(*this, a); return *this;};
  inline FP_NR<F> &operator*=(const FP_NR<F> &a) { this->mul(*this, a); return *this;};
  inline FP_NR<F> &operator/=(const FP_NR<F> &a) { this->div(*this, a); return *this;};

  inline FP_NR<F> &operator+=(const double a) { FP_NR<F> t=a; this->add(*this, t); return *this;};
  inline FP_NR<F> &operator-=(const double a) { FP_NR<F> t=a; this->sub(*this, t); return *this;};
  inline FP_NR<F> &operator*=(const double a) { this->mul_d(*this, a); return *this;};
  inline FP_NR<F> &operator/=(const double a) { this->div(*this, FP_NR<F>(a)); return *this;};


  /**
   * max between a and b
   */
  inline FP_NR &max_f(FP_NR<F> &b)
  {
    if ((*this) <= b)
      return b;
    else
      return (*this);
  }

  /**
   * Returns non-zero if the current value is zero, 0 otherwise.
   */
  inline bool is_zero() const;
  inline int zero_p() const { return is_zero(); }

  /**
   * Returns non-zero if the current value is NaN, 0 otherwise.
   */
  inline int is_nan() const;

  /**
   * Returns non-zero if !isnan(value) and !isinf(value), 0 otherwise.
   */
  inline int is_finite() const;

  /** arithmetic */

  /**
   * value := a + b.
   */
  inline void add(const FP_NR<F> &a, const FP_NR<F> &b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := a - b.
   */
  inline void sub(const FP_NR<F> &a, const FP_NR<F> &b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := a * b.
   */
  inline void mul(const FP_NR<F> &a, const FP_NR<F> &b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := a * b where b is double.
   */
  inline void mul_d(const FP_NR<F> &a, const double b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := a * b where b is mpfr_t.
   */
  inline void mul_mpfr(const FP_NR<mpfr_t> &a, const mpfr_t b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := a * 2^b.
   */
  inline void mul_2si(const FP_NR<F> &a, long b);

  /**
   * value := a / b.
   */
  inline void div(const FP_NR<F> &a, const FP_NR<F> &b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := a / b.
   */
  inline void div_d(const FP_NR<F> &a, const double b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := value + a * b.
   */
  inline void addmul(const FP_NR<F> &a, const FP_NR<F> &b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := value - a * b.
   */
  inline void submul(const FP_NR<F> &a, const FP_NR<F> &b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := a^b.
   */
  inline void pow_si(const FP_NR<F> &a, long b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := e^b.
   */
  inline void exponential(const FP_NR<F> &b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := natural logarithm of a.
   */
  inline void log(const FP_NR<F> &a, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := square root of b.
   */
  inline void sqrt(const FP_NR<F> &b, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := k-th root of b.
   */
  inline void root(const FP_NR<F> &b, unsigned int k, mp_rnd_t rnd = GMP_RNDN);

  /**
   * value := -b.
   */
  inline void neg(const FP_NR<F> &b);

  /**
   * value := absolute value of b.
   */
  inline void abs(const FP_NR<F> &b);

  /**
   * value := rounding of b to the nearest integer.
   */
  inline void rnd(const FP_NR<F> &b);

  /**
   * value <- (rounding of a * 2^expo_add) / 2^expo_add, but never overflows.
   * expo_add must be 0 if T=dpe_t or T=mpfr_t.
   */
  inline void rnd_we(const FP_NR<F> &b, long expo_add);

  /**
   * value := largest integer not greater than b.
   */
  inline void floor(const FP_NR<F> &b);

  /**
   * value := NaN.
   */
  inline void set_nan();

  /**
   * Efficiently swaps the values of two FP_NR.
   */
  inline void swap(FP_NR<F> &a);

};  // End class FP_NR

template <class F> inline FP_NR<F> operator+(const FP_NR<F> &a, const FP_NR<F> &b)
{
  FP_NR<F> r;
  r.add(a, b);
  return r;
}

template <class F> inline FP_NR<F>&& operator+(FP_NR<F> &&a, const FP_NR<F> &b)
{
  a.add(a, b);
  return std::move(a);
}


template <class F> inline FP_NR<F> operator+(const FP_NR<F> &a, double b)
{
  FP_NR<F> r;
  r = b;
  r.add(r, a);
  return r;
}

template <class F> inline FP_NR<F> operator+(double a, const FP_NR<F> &b)
{
  FP_NR<F> r;
  r = a;
  r.add(r, b);
  return r;
}

template <class F> inline FP_NR<F> operator+(const FP_NR<F> &a, long b)
{
  FP_NR<F> r;
  r = b;
  r.add(a, r);
  return r;
}

template <class F> inline FP_NR<F> operator+(long a, const FP_NR<F> &b)
{
  FP_NR<F> r;
  r = a;
  r.add(r, b);
  return r;
}


template <class F> inline FP_NR<F> operator-(const FP_NR<F> &a, const FP_NR<F> &b)
{
  FP_NR<F> r;
  r.sub(a, b);
  return r;
}


template <class F> inline FP_NR<F> operator-(const FP_NR<F> &a, double b)
{
  FP_NR<F> r;
  r = b;
  r.sub(a, r);
  return r;
}

template <class F> inline FP_NR<F> operator-(double a, const FP_NR<F> &b)
{
  FP_NR<F> r;
  r = a;
  r.sub(r, b);
  return r;
}

template <class F> inline FP_NR<F> operator-(const FP_NR<F> &a, long b)
{
  FP_NR<F> r;
  r = b;
  r.sub(a, r);
  return r;
}

template <class F> inline FP_NR<F> operator-(long a, const FP_NR<F> &b)
{
  FP_NR<F> r;
  r = a;
  r.sub(r, b);
  return r;
}

template <class F> inline FP_NR<F> operator*(const FP_NR<F> &a, const FP_NR<F> &b)
{
  FP_NR<F> r;
  r.mul(a, b);
  return r;
}

template <class F> inline FP_NR<F>&& operator*(FP_NR<F> &&a, const FP_NR<F> &b) {
  a.mul(a, b);
  return std::move(a);
}

template <class F> inline FP_NR<F> operator*(const FP_NR<F> &a, double b)
{
  FP_NR<F> r;
  r.mul_d(a, b);
  return r;
}

template <class F> inline FP_NR<F> operator*(const FP_NR<F> &a, long b)
{
  FP_NR<F> r;
  r = b;
  r.mul(r, a);
  return r;
}

template <class F> inline FP_NR<F> operator*(double a, const FP_NR<F> &b)
{
  FP_NR<F> r;
  r.mul_d(b, a);
  return r;
}


template <class F> inline FP_NR<F>&& operator*(FP_NR<F> &&a, double b) {
  a.mul_d(a, b);
  return std::move(a);
}

template <class F> inline FP_NR<F> operator/(const FP_NR<F> &a, const FP_NR<F> &b) {
  FP_NR<F> r;
  r.div(a, b);
  return r;
}

template <class F> inline FP_NR<F> operator/(const FP_NR<F> &a, const double b) {
  FP_NR<F> r;
  r.div(a, b);
  return r;
}

template <class F> inline FP_NR<F> operator/(const double a, const FP_NR<F> &b) {
  FP_NR<F> r;
  r.div(a, b);
  return r;
}

template <class F> inline FP_NR<F> sqrt(const FP_NR<F> &a) {
  FP_NR<F> r;
  r.sqrt(a);
  return r;
}

template <class F> inline FP_NR<F>&& sqrt(FP_NR<F> &&a) {
  a.sqrt(a);
  return std::move(a);
}

template <class F> inline FP_NR<F> abs(const FP_NR<F> &a) {
  FP_NR<F> r;
  r.abs(a);
  return r;
}

template <class F> inline FP_NR<F>&& abs(FP_NR<F> &&a) {
  a.abs(a);
  return std::move(a);
}


template <class F> inline FP_NR<F> floor(const FP_NR<F> &a) {
  FP_NR<F> r;
  r.floor(a);
  return r;
}

template <class F> inline FP_NR<F>&& floor(FP_NR<F> &&a) {
  a.floor(a);
  return std::move(a);
}


template <class F> inline FP_NR<F> log(const FP_NR<F> &a) {
  FP_NR<F> r;
  r.log(a);
  return r;
}

template <class F> inline FP_NR<F>&& log(FP_NR<F> &&a) {
  a.log(a);
  return std::move(a);
}

template <class F> inline FP_NR<F> exp(const FP_NR<F> &a) {
  FP_NR<F> r;
  r.exponential(a);
  return r;
}

template <class F> inline FP_NR<F>&& exp(FP_NR<F> &&a) {
  a.exponential(a);
  return std::move(a);
}

template <class F> inline FP_NR<F> pow_si(const FP_NR<F> &a, long b) {
  FP_NR<F> r;
  r.pow_si(a, b);
  return r;
}

template <class F> inline FP_NR<F> &&pow_si(FP_NR<F> &&a, long b) {
  a.pow_si(a, b);
  return std::move(a);
}

template <class F> inline FP_NR<F> root(const FP_NR<F> &a, unsigned int b) {
  FP_NR<F> r;
  r.root(a, b);
  return r;
}

template <class F> inline FP_NR<F> &&root(FP_NR<F> &&a, unsigned int b) {
  a.root(a, b);
  return std::move(a);
}


/**
 * FP_NR: some generic functions.
 */
template <class F> inline void FP_NR<F>::addmul(const FP_NR<F> &b, const FP_NR<F> &c, mp_rnd_t rnd)
{
  FP_NR<F> product;
  product.mul(b, c, rnd);
  add(*this, product, rnd);
}
template <class F> inline void FP_NR<F>::submul(const FP_NR<F> &b, const FP_NR<F> &c, mp_rnd_t rnd)
{
  FP_NR<F> product;
  product.mul(b, c, rnd);
  sub(*this, product, rnd);
}
template <class F> inline bool FP_NR<F>::operator<(const FP_NR<F> &a) const { return cmp(a) < 0; }
template <class F> inline bool FP_NR<F>::operator>(const FP_NR<F> &a) const { return cmp(a) > 0; }
template <class F> inline bool FP_NR<F>::operator<(double a) const { return cmp(a) < 0; }
template <class F> inline bool FP_NR<F>::operator>(double a) const { return cmp(a) > 0; }

/** overloading stream operators */

/**
 * Prints x on stream os.
 */
template <class T> ostream &operator<<(ostream &os, const FP_NR<T> &x) { return os << x.get_data(); }

#ifdef FPLLL_WITH_DPE
template <> ostream &operator<<(ostream &os, const FP_NR<dpe_t> &x);
#endif

template <> ostream &operator<<(ostream &os, const FP_NR<mpfr_t> &x);

FPLLL_END_NAMESPACE

#endif