# HG changeset patch
# User Robert Bradshaw <robertwb@math.washington.edu>
# Date 1273962973 25200
# Node ID ad36c5f2487ff27c8b4e24908ddea4393d615ec7
# Parent 53fca1224c15b62db0108dbbd0d975af71320501
#8896  High precision zero parsed incorrectly.
diff r 53fca1224c15 r ad36c5f2487f sage/rings/real_mpfr.pyx
a

b


4510  4510  sage: RealNumber(10) 
4511  4511  10.0000000000000 
4512  4512  sage: RealNumber('1.0000000000000000000000000000000000') 
4513   1.000000000000000000000000000000000 
 4513  1.0000000000000000000000000000000000 
4514  4514  sage: RealField(200)(1.2) 
4515  4515  1.2000000000000000000000000000000000000000000000000000000000 
4516  4516  sage: (1.2).parent() is RR 
… 
… 

4522  4522  53 
4523  4523  sage: RealNumber('.000000000000000000000000000000001').prec() 
4524  4524  53 
4525   """ 
 4525  
 4526  sage: RealNumber('.11111111111111111111111111111111111').prec() 
 4527  120 
 4528  sage: RealNumber('1.1111111111111111111111111111111111').prec() 
 4529  120 
 4530  sage: RealNumber('11111111111111111111111111111111111.').prec() 
 4531  120 
 4532  sage: RealNumber('.00000000000000000000000000000000000').prec() 
 4533  120 
 4534  sage: RealNumber('0.0000000000000000000000000000000000').prec() 
 4535  120 
 4536  """ 
 4537  cdef int i, sigfigs 
4526  4538  if not isinstance(s, str): 
4527  4539  s = str(s) 
4528  4540  
… 
… 

4539  4551  else: 
4540  4552  mantissa = s 
4541  4553  
4542   #Find the first nonzero entry in rest 
4543   sigfigs = 0 
 4554  #Find the first nonzero entry in mantissa 
 4555  sigfigs = len(mantissa) 
4544  4556  for i in range(len(mantissa)): 
4545   if mantissa[i] != '.' and mantissa[i] != '0' and mantissa[i] != '': 
4546   sigfigs = len(mantissa)  i 
 4557  if mantissa[i] == '0': 
 4558  sigfigs = 1 
 4559  elif mantissa[i] != '.' and mantissa[i] != '': 
4547  4560  break 
4548   
4549   if '.' in mantissa and mantissa[:2] != '0.': 
 4561  else: 
 4562  # Must be 0.00000000000000...0 
 4563  sigfigs = len(mantissa) 
 4564  
 4565  if mantissa[0] == '': 
4550  4566  sigfigs = 1 
4551  4567  
4552  4568  if base == 10: 