Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
GeneralRe: Logic of prime numbers Pin
Pete O'Hanlon2-Jan-15 23:23
mvePete O'Hanlon2-Jan-15 23:23 
GeneralRe: Logic of prime numbers Pin
BillWoodruff3-Jan-15 0:42
professionalBillWoodruff3-Jan-15 0:42 
GeneralRe: Logic of prime numbers Pin
Richard MacCutchan3-Jan-15 0:47
mveRichard MacCutchan3-Jan-15 0:47 
GeneralRe: Logic of prime numbers Pin
BillWoodruff3-Jan-15 11:57
professionalBillWoodruff3-Jan-15 11:57 
GeneralRe: Logic of prime numbers Pin
Richard MacCutchan3-Jan-15 21:05
mveRichard MacCutchan3-Jan-15 21:05 
GeneralRe: Logic of prime numbers Pin
BillWoodruff3-Jan-15 21:21
professionalBillWoodruff3-Jan-15 21:21 
GeneralRe: Logic of prime numbers Pin
Richard MacCutchan3-Jan-15 22:02
mveRichard MacCutchan3-Jan-15 22:02 
AnswerRe: Logic of prime numbers Pin
SledgeHammer012-Jan-15 14:16
SledgeHammer012-Jan-15 14:16 
value % whatever == 0 is checking for *no* remainder when divided by whatever.

Your algorithm should not be testing against 1 since every number is divisible by 1. There is a more optimized "standard" algorithm that increments by 6 on each iteration rather then 1. But that's about as efficient as you'll get. There isn't any efficient publicly known algorithm. Maybe the CIA spooks have one though LOL...

Being able to easily factor prime numbers would render all forms of cryptography useless.
GeneralRe: Logic of prime numbers Pin
Member 113371082-Jan-15 14:19
Member 113371082-Jan-15 14:19 
GeneralRe: Logic of prime numbers Pin
SledgeHammer012-Jan-15 14:32
SledgeHammer012-Jan-15 14:32 
GeneralRe: Logic of prime numbers Pin
Member 113371082-Jan-15 15:06
Member 113371082-Jan-15 15:06 
GeneralRe: Logic of prime numbers Pin
SledgeHammer012-Jan-15 15:24
SledgeHammer012-Jan-15 15:24 
GeneralRe: Logic of prime numbers Pin
BillWoodruff3-Jan-15 11:59
professionalBillWoodruff3-Jan-15 11:59 
Questionhow can get number in a string in c# :(((((( Pin
mhd.sbt2-Jan-15 6:13
mhd.sbt2-Jan-15 6:13 
AnswerRe: how can get number in a string in c# :(((((( Pin
Pete O'Hanlon2-Jan-15 6:28
mvePete O'Hanlon2-Jan-15 6:28 
AnswerRe: how can get number in a string in c# :(((((( Pin
BillWoodruff2-Jan-15 7:43
professionalBillWoodruff2-Jan-15 7:43 
QuestionCan I write my own XBox 360 program? Pin
trantrum2-Jan-15 4:41
professionaltrantrum2-Jan-15 4:41 
AnswerRe: Can I write my own XBox 360 program? Pin
Richard MacCutchan2-Jan-15 4:53
mveRichard MacCutchan2-Jan-15 4:53 
AnswerRe: Can I write my own XBox 360 program? Pin
OriginalGriff2-Jan-15 5:00
mveOriginalGriff2-Jan-15 5:00 
GeneralRe: Can I write my own XBox 360 program? Pin
trantrum2-Jan-15 5:07
professionaltrantrum2-Jan-15 5:07 
GeneralRe: Can I write my own XBox 360 program? Pin
OriginalGriff2-Jan-15 5:13
mveOriginalGriff2-Jan-15 5:13 
GeneralRe: Can I write my own XBox 360 program? Pin
trantrum2-Jan-15 5:21
professionaltrantrum2-Jan-15 5:21 
GeneralRe: Can I write my own XBox 360 program? Pin
OriginalGriff2-Jan-15 5:25
mveOriginalGriff2-Jan-15 5:25 
AnswerRe: Can I write my own XBox 360 program? Pin
BillWoodruff2-Jan-15 6:56
professionalBillWoodruff2-Jan-15 6:56 
GeneralRe: Can I write my own XBox 360 program? Pin
trantrum2-Jan-15 9:20
professionaltrantrum2-Jan-15 9:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.