Re: Looking for a Better atof()
From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 03/09/04
- Next message: Joseph M. Newcomer: "Re: Enable users to modify Protected Registry Keys"
- Previous message: Rich S.: "How to use NM_CLICK with a CTreeCtrl"
- In reply to: Jonathan Wood: "Looking for a Better atof()"
- Next in thread: Jonathan Wood: "Re: Looking for a Better atof()"
- Reply: Jonathan Wood: "Re: Looking for a Better atof()"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 08 Mar 2004 21:41:20 -0500
For a "better floating point", there is a simple fix: code your own that simply validates
the syntax of the floating point number. When you know it is correct, you call the
standard C routine.
There is a floating-point parser that does exactly this checking shown in my Validating
Edit Control on my MVP Tips site.
joe
On Mon, 8 Mar 2004 14:57:29 -0700, "Jonathan Wood" <jwood@softcircuits.com> wrote:
>Does anyone know of any code for a better atof() routine?
>
>Specifically, I'm looking for code that will report bad characters or
>out-of-range strings. I'm looking for the same thing for int, _int64, float,
>and single as well. I can code my own for integers but just don't know where
>to start for floating point. (It appears routines like atof() simply return
>0.0 if the string is invalid, but 0.0 could also be a valid result.)
>
>Any tips appreciated!
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Next message: Joseph M. Newcomer: "Re: Enable users to modify Protected Registry Keys"
- Previous message: Rich S.: "How to use NM_CLICK with a CTreeCtrl"
- In reply to: Jonathan Wood: "Looking for a Better atof()"
- Next in thread: Jonathan Wood: "Re: Looking for a Better atof()"
- Reply: Jonathan Wood: "Re: Looking for a Better atof()"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|