[EMAIL PROTECTED] (Bob Proulx) wrote: > On some cpus the result is done one way and on others the result is > done a different way. It is in these cases where typically POSIX > would give up and declare it undefined behavior.
Yes, and those are exactly the cases where a message would be helpful, to let the user know that the result is not portable, and does not necessarily indicate what the user thinks it does. Undefined behavior makes sense for C, since C is essentially a "portable assembly language". For a higher-level language, it makes considerably less sense. And in any case, it does not require the implementation to be unhelpful. > About the only way for bash to avoid it would be to include a full > arbitrary precision math library to evaluate these expressions > itself. It depends on the goal. If the goal is to produce a mathematically correct result, then yes. But if the goal is only to detect overflow and print a warning, then that can still be done without arbitrary precision. paul _______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash