From: Arjen M. <arj...@wl...> - 2005-10-05 06:27:56
|
Kevin Kenny wrote: > > arj...@wl... said: > > In general what should happen if a mathematical function is to be > > evaluated for a set of argument for which it is not defined? > > Hmm, in 8.5, you'll just be able to return NaN. :) > > Returning a clearer message is probably better than a simple > division by zero, which is likely to get reported as a bug. > I've got a bunch of such checks in places like modules/math/combinatorics.tcl, > where there are [return -code error] for most of the corner cases. > Yes, this morning I realised that with Tcl 8.5 things could and would be different. I still opt for the error message, rather than the NaN (or Inf) that the extended numerical features make possible, because it seems to me to give the least surprises. Regards, Arjen |