On Sat, Nov 03, 2012 at 04:37:44PM -0430, Andres Perera wrote:
> On Sat, Nov 3, 2012 at 3:56 PM, Otto Moerbeek <[email protected]> wrote:
> >>
> >> also, requesting something like this just to workaround a warning
> >> is counter productive, especially when you need a fraction during
> >> an expression that involves exponentiation
> >
> > Dunno, gnu bc/dc also warn in this case, and I think it is a useful warning.
>
> only if there is a truncate or floor -Inf function builtin, otherwise
> you have to implement it yourself
>
> requesting changing scale nilly willy at top level isn't good because
> it affects all expressions
>
> if there were an inversion of behaviour with C:
>
> bc:
>
> b ^ trunc(e) /* easy to avoid warning */
>
> C:
>
> cast_assignment_to_bool = 1
> if (x = y) statement; /* not easy to avoid warning */
> cast_assignment_to_bool = 0
>
> well, except that the bc workaround requires more work than the
> fictional braindead substitute for wrapping C assignments in
> parenthesis
It's easy to create a trunc function. Yes it will needs scale setting
en resetting, but I do not see that as a problem.
On the other hand, being reminded that ^ does not do fractional exponents
is very important.
-Otto