[RFC PATCH] Warn about commas in floating point values?

Linus Torvalds torvalds at linux-foundation.org
Thu Mar 7 11:43:51 PST 2013


On Thu, Mar 7, 2013 at 11:29 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> Take your value, count the total number of dots and commas combined and
> if it is one than assume that's a dot. If someone writes 3000kg as
> 3,000kg they get what they deserve...

That's not my primary worry. Some of the crazy stuff we import uses
pascal, so you have numbers like 3,7e5

So now we need to parse exponents too.

I'd be more inclined to say "let's replace the comma with a decimal
point instead, and try to re-parse the number, and see if we get
further. The downside of that is that we're changing the buffer we get
passed in. Nobody cares, but still, it's kind of ugly. It's simple,
though. Attached.

           Linus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 609 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130307/f0d029a2/attachment.obj>


More information about the subsurface mailing list