Cobbal and grokus are right. The Miller-Rabin test is the most useful of the available algorithms. Yes, it is probabilistic, but really shouldn't scare you off. The test is the most widely used for practical purposes.
Note that the probability of false positives (there are no false negatives) can be made arbitrarily small by repeating the test.