Ruud H.G. van Tol on Wed, 29 Mar 2023 13:27:05 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Fwd: Speed versus clarity



On 2023-03-29 12:04, Bill Allombert wrote:
For example for issquare(N), in some application, N wil almost always be a square,
while in other N will almost never be a square. Ideally one should not use the
same algorithm for both case.

Then maybe issquare wants to grow a hint-flag (as an extra parameter),
to give the caller a way to influence that decision.

Another option is to have 2 names:
issquare_while_unlikely
issquare_while_likely

but then what to do if
issquare_while_unlikely(t_COMPLEX)
gets called ...
:)

-- Ruud