|
Boost Users : |
Subject: Re: [Boost-users] [spirit] real_p fails on negative exponent
From: Joel de Guzman (joel_at_[hidden])
Date: 2008-12-08 08:09:32
Joel de Guzman wrote:
> Jan Boehme wrote:
>> Hi,
>>
>> on my system (RHEL3, libc 2.3.2, gcc 3.2.3, Intel 10.1 which is used
>> to compile and link) real_p fails to parse real numbers like 1.0E-001
>> and it is most likely the negative exponent as 1.0E001 works as expected.
>> Our investigations brought us to numerics.hpp line 162 where the int
>> parser which is used by real_p is declared as 'int_parser<T, 10, 1,
>> -1>' with T=double. I don't see the reason for this yet and
>> the 'out of the box' int parser 'int_p' itself is declared using
>> 'int_parser<int>'.
>>
>> Here my questions:
>> Do I have to expect any problems using int instead double for the
>> real_p exp_n parser?
>> Is this a kind of a mistake as even int_p is declared using 'int'?
>
> Please post a minimal test case. I'd venture a guess that the problem
> is elsewhere. We do have real_p tests with negative exponents. And
> all is fine, as expected. I did test your case and it works fine:
>
> added this in numeric_tests.cpp:
>
> BOOST_TEST(parse("1.0E-001", real_p).full); // Good.
Oh and BTW, there's a Spirit mailing list:
https://lists.sourceforge.net/lists/listinfo/spirit-general
Regards,
-- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net