[RFC] moneypunct::frac_digits < 0 ?!?

Nathan Myers ncm-nospam@cantrip.org
Wed Mar 3 15:53:00 GMT 2004


On Wed, Mar 03, 2004 at 04:29:51PM +0100, Paolo Carlini wrote:
> Paolo Carlini wrote:
> 
> >So, if frac_digits() is, say -2?
> >
> >If I understand well your message, no digits are required after the
> >decimal_point and we discard the rightmost two digits of the integer 
> >part.
> 
> ... but in that case, what happens if the integer part is < 100?!?
> 
> We actually parse zero? The user inputs, say, 75.8 and we parse zero, are
> you sure that we really want this behavior?

I think the consistent behavior would be to report a parse error if 
the low digits were not all zero.  (If you can't represent the input
internally, that's an error.)

BTW, since the standard doesn't say what happens for negative values,
the behavior is unspecified, and we're allowed to do almost anything.  
After we get it deployed and demonstrate it works, we can write up what 
we did, and submit it as "standardizing existing practice". :-)

Nathan Myers
ncm@cantrip.org



More information about the Libstdc++ mailing list