Wrote a blog post about CTFE and D
Dmitry Olshansky
dmitry.olsh at gmail.com
Thu Aug 30 09:26:59 PDT 2012
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
More information about the Digitalmars-d-announce
mailing list