MCPcopy Create free account
hub / github.com/ZDoom/Raze / IsFloat

Function IsFloat

source/common/console/c_expr.cpp:248–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246//==========================================================================
247
248bool IsFloat (const char *str)
249{
250 const char *pt;
251
252 if (*str == '+' || *str == '-')
253 str++;
254
255 if (*str == '.')
256 {
257 pt = str;
258 }
259 else
260 {
261 pt = CIsNum (str);
262 if (pt == NULL)
263 return false;
264 }
265 if (*pt == '.')
266 {
267 pt = CIsNum (pt+1);
268 if (pt == NULL)
269 return false;
270 }
271 if (*pt == 'e' || *pt == 'E')
272 {
273 pt++;
274 if (*pt == '+' || *pt == '-')
275 pt++;
276 pt = CIsNum (pt);
277 }
278 return pt != NULL && *pt == 0;
279}
280
281//==========================================================================
282//

Callers 2

ParseExpressionFunction · 0.85
ResolveMethod · 0.85

Calls 1

CIsNumFunction · 0.85

Tested by

no test coverage detected