# HG changeset patch
# User Volker Braun
# Date 1329868056 28800
# Node ID a202ee88c02e9765b6b8e4f4b34e4b6ea59944c0
# Parent 65c70eeebf8baba98019b8a8c03c0d4001f636a4
Trac #11666: Upgrade MPFR to 3.1.0
This patch removes the ugly hack that is no longer
necessary to have the same random numbers on 32 and 64 bit
diff --git a/sage/rings/real_mpfr.pyx b/sage/rings/real_mpfr.pyx
--- a/sage/rings/real_mpfr.pyx
+++ b/sage/rings/real_mpfr.pyx
@@ -928,19 +928,6 @@
"""
cdef RealNumber x = self._new()
cdef randstate rstate = current_randstate()
- if sizeof(long) == 4:
- # This is a gross hack that depends on the internals of
- # MPFR... but that's OK, because if MPFR changes it will
- # be instantly caught by the doctests above.
- # MPFR rounds up the precision to a multiple of the
- # current word size, then requests that many bits from
- # .gmp_state . So if (1 <= precision mod 64 <= 32),
- # a 64-bit machine will request 32 more bits than a 32-bit
- # machine, and the random numbers will get out of sync.
- # We work around this problem by requesting an extra
- # 32 bits on a 32-bit machine.
- if 1 <= self.__prec % 64 <= 32:
- rstate.c_random()
mpfr_urandomb(x.value, rstate.gmp_state)
if min == 0 and max == 1:
return x