|
|
clipka <ano### [at] anonymousorg> wrote:
I take it that's an implied confirmation that select() evaluates all the return
arguments before returning the conditional result.
> Are you sure that N-V=0, too?
"Yes." #for (V, 0, N)....
So N-V when V=N _should_ indeed "equal zero"
But I'm in the middle of debugging the chain-linked macros I've coded, so I
shall find out for certain.
Right now, I'm making them more svelt. More chain-link, less barbed-wire.
> In a macro? Why, yes, of course! Why not use `#if` instead of `select`?
Because that seemed iffy? :P
I like to branch out and sample the different methods of doing things, and keep
my function {} skills unatrophied. :P
Because sometimes I just don't like the if-[then]-else-end block and select()
seemed visually neater. And every little thing that's not distracting helps.
> > Isn't there a pow function that tolerates / passes through pow(0,0) as 0, like
> > the magical atan2 ?
>
> And what result should that function return?
Bags of hundred dollar bills.
Oh, how I could have bet money that this question would be asked... :D
> In some applications, you may want the result to be 1, to conform with
> x^0=1;
pow1 (x, 0) = 1
> in other applications, a result of 0 would make more sense, to
> conform with 0^x=0.
pow0 (x,0) = 1
> And in yet other applications, the most sensible thing to do is catch
> this case further upstream and report that something's just totally wrong.
pow (x, 0) = undefined, out of range, error, nil, nul, whatever you'd like.
Maybe just make it a warning.
roll it up to include all three:
pow (x, 0, Mode)
Something. I just think that 25-year-old legendary software ought to be mature
enough to not require the user to code their way out of something that should
only require a switch or the trivial documented use of an alternate function -
like with atan() and atan2().
Post a reply to this message
|
|