OK, I see : the perl comments are included in the C source, and of course a line beginning with a # has unexpected effects there :) So adding a // in front of lines 137 and 164 saves the day:
ok 1 - The first 501 primes are found from 1 to 3571.
ok 2 - external_cpp() function gives same results as basic_perl().
ok 3 - inline_c() function gives same results as basic_perl().
# Comparing basic_perl(), external_cpp(), and inline_c() for
# 5 seconds searching 150000 integers.
Rate basic_perl external_cpp inline_c
basic_perl 0.984/s -- -90% -96%
external_cpp 9.45/s 860% -- -58%
inline_c 22.6/s 2197% 139% --
# I love it when a plan comes together.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||