Primality by trial division: Difference between revisions

Content deleted Content added
→‎{{header|Ada}}: "return" statement cleanly exits from loops, therefore no need for a Result variable
→‎{{header|Ada}}: while condition shall be <= (or it skips square numbers)
Line 443: Line 443:
else
else
Test := 3;
Test := 3;
while Test < Integer(Sqrt(Float(Item))) loop
while Test <= Integer(Sqrt(Float(Item))) loop
if Item mod Test = 0 then
if Item mod Test = 0 then
return False;
return False;