--- layout: post author: Pascal Cuoq date: 2012-11-28 23:44 +0200 categories: c99 floating-point format: xhtml title: "C99 quiz" summary: --- {% raw %}
Here is a convenient one-liner:
int l(unsigned int x) { return *(char*)(float[]){x*x} - 63; }
What does it do on my faithful PowerMac?
The Intel version is not as nice. That's progress for you: *(3+(char*)(float){x*x}) - 63