[
https://issues.apache.org/jira/browse/MATH-845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13435004#comment-13435004
]
Gilles commented on MATH-845:
-----------------------------
bq. [...] I tend to prefer assertions over simple comments (assertions could be
turned on (at least, locally) during testing).
IMO, neither "assert" statements nor simple comments are useful for testing (or
more precisely, debugging). What we'd need is logging.
"assert" aborts the program, but does not tell you how the wrong value made it
there.
I think that "assert" is very useful, but in _applications_ (meaning: don't
bother with the rest of the computation, as *I* know that someting went wrong).
By contrast, in CM, no "assert" should ever be triggered from internal calls.
Furthermore, no "assert" should ever be triggered from external calls, as that
would mean that unsafe (if assertions are disabled) code can be called.
To be robust, CM raises a "MathInternalError" at places no code path should
ever lead to; but if one does, at least something predictable happens.
One thing to check in the first place is whether a precondition check actually
slows down things in an "unbearable" way.
> Basic number theory features such as primality testing, factorization and
> prime number generation
> -------------------------------------------------------------------------------------------------
>
> Key: MATH-845
> URL: https://issues.apache.org/jira/browse/MATH-845
> Project: Commons Math
> Issue Type: New Feature
> Affects Versions: 3.1
> Environment: ubuntu/java6/intel-i5
> Reporter: Sebastien Riou
> Priority: Minor
> Labels: features
> Fix For: 3.1
>
> Attachments: primes-src.zip
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> A set of static methods to perform primality test, factorization and prime
> number generation. Currently it is limited to the int data type, extension to
> long/BigInteger will follow.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira