Skip to content

Instantly share code, notes, and snippets.

@kazuho
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazuho/83cde8ab0579b463f7bc to your computer and use it in GitHub Desktop.
Save kazuho/83cde8ab0579b463f7bc to your computer and use it in GitHub Desktop.
static inline unsigned _qrintf_log10l(unsigned long v)
{
if (sizeof(v) == 8) {
return _qrintf_log10ll(v);
} else if (siveof(v) == 4) {
... __builtin_clzl(... v ...);
} else {
assert(!"long is not 32bit nor 64bit");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment