MCPcopy Create free account
hub / github.com/WheretIB/nullc / parseLong

Function parseLong

NULLC/Callbacks.cpp:356–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354}
355
356long long parseLong(const char* s, const char* e, int base)
357{
358 unsigned long long res = 0;
359 for(const char *p = s; p < e; p++)
360 {
361 int digit = ((*p >= '0' && *p <= '9') ? *p - '0' : (*p & ~0x20) - 'A' + 10);
362 if(digit < 0 || digit >= base)
363 ThrowError(p, "ERROR: digit %d is not allowed in base %d", digit, base);
364 res = res * base + digit;
365 }
366 return res;
367}
368
369double parseDouble(const char *str)
370{

Callers 4

AddNumberNodeLongFunction · 0.85
AddHexIntegerFunction · 0.85
AddOctIntegerFunction · 0.85
AddBinIntegerFunction · 0.85

Calls 1

ThrowErrorFunction · 0.85

Tested by

no test coverage detected