4.2.3: mpf_set_str() no longer recognizes exponents with '+' prefix

Vincent Lefevre vincent at vinc17.org
Sat Aug 16 21:27:41 CEST 2008


On 2008-08-16 12:55:56 +0200, Jan Andres wrote:
> Actually, this has worked for me in 4.2.1. In that version, a call to
> strtol() was used to parse the exponent and it seems that at least on
> Linux, strtol() doesn't mind about a leading '+'.

The ISO C99 standard allows a leading '+':

       [#3]  If the value of base is zero, the expected form of the
       subject sequence is that of an integer constant as described
       in 6.4.4.1, optionally preceded by a plus or minus sign, but
       not including an integer suffix.  If the value  of  base  is
       between  2  and  36  (inclusive),  the  expected form of the
       subject  sequence  is  a  sequence  of  letters  and  digits
       representing  an  integer  with the radix specified by base,
       optionally preceded  by  a  plus  or  minus  sign,  but  not
       including  an  integer  suffix.   The  letters from a (or A)
[...]

-- 
Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


More information about the gmp-bugs mailing list