Why I chose D over Ada and Eiffel

Timon Gehr timon.gehr at gmx.ch
Fri Aug 30 04:44:02 PDT 2013


On 08/30/2013 11:14 AM, deadalnix wrote:
> On Friday, 30 August 2013 at 08:10:24 UTC, Timon Gehr wrote:
>> On 08/30/2013 01:35 AM, Timon Gehr wrote:
>>>
>>> bool isPrime(int x){ return iota(3,x).all!(a=>!!(x%a)); }
>>
>> bool isPrime(int x){ return 1<x && iota(3,x).all!(a=>!!(x%a)); }
>
> iota(3, to!int(sqrt(x)))

http://en.wikipedia.org/wiki/AKS_primality_test


More information about the Digitalmars-d mailing list