MCPcopy Create free account
hub / github.com/MegEngine/MegCC / parse_float

Function parse_float

runtime/flatcc/include/flatcc/portable/pparsefp.h:118–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116#endif
117
118static inline const char *parse_float(const char *buf, size_t len, float *result)
119{
120 const char *end;
121 double v;
122 union { uint32_t u32; float f32; } inf;
123 inf.u32 = 0x7f800000;
124
125 end = parse_double(buf, len, &v);
126 *result = (float)v;
127 if (parse_float_isinf(*result)) {
128 *result = v < 0 ? -inf.f32 : inf.f32;
129 return buf;
130 }
131 return end;
132}
133
134#include "pdiagnostic_pop.h"
135

Callers

nothing calls this directly

Calls 2

parse_doubleFunction · 0.85
parse_float_isinfFunction · 0.85

Tested by

no test coverage detected