On 30-Aug-12 13:41, Danny Arends wrote:
I wrote a blog post about the stuff I've been doing last weekend using
CTFE.
All comments are welcome, you can find the blog post at:
http://www.dannyarends.nl/index.cgi?viewDetailed=00029
Danny Arends
http://www.dannyarends.nl
Nice read.
A couple of nits:
Use T[2] for fixed arrays like Cord one. It also helps tremendously for
lookup speed of the final lookup table. Thus instead of array of arrays
you'd have an array of pairs i.e. 2 indirections ---> 1 indirection and
cache friendly layout.
And an awful typo in degreeloop function I think:
pure int degreeloop(int deg){
while(deg < 0 || deg >= 360){
if(deg < 0) deg += 360;
if(deg >= 0) deg -= 360; //shouldn't it be >= 360 ??
}
return deg;
}
--
Olshansky Dmitry