Coder Profile - Show off your skills, get a coder profile.
 
 
 
code pin board Prime Sieve - Project Euler 10 Download Source Code
Author Details Code Information
CodeMangler

Pinned 1 Codes
Posted 0 Coding Articles

Send A Message
View Coders Profile
Language Plain Text
Expires Never
Length 462 Characters (14 Lines)
Password no password
  1. let prime_series_sieve (limit:bigint) =
  2.     let series = List.to_array [0I..limit]
  3.     series.SetValue(0I, 1)
  4.  
  5.     let rec eliminate_multiples (n:bigint) (i:bigint) =
  6.         let index = (i * n)
  7.         if index < bigint.Parse(series.Length.ToString()) then
  8.             series.SetValue(0I, (bigint.ToInt64(index)))
  9.             eliminate_multiples n (i + 1I)
  10.  
  11.     for n in [2I..(limit/2I)] do
  12.         eliminate_multiples n 2I
  13.  
  14.     series;;
code pin board Back To Code Pin Board Post New Code
Please login to post comments.
Page 1 of 1
 
 
Latest News About Coder Profile
Coder Profile Poll
Which sounds better on your coder profiles, and makes more sense to you (think twitter, facebook, etc)?

Followers / Following
Fans / Following
Fans / Fan Of


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
3.20 Years Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright © 2007 - 2012, Scott Thompson, All Rights Reserved