Emil Jerabek wrote:
On Sun, Aug 31, 2003 at 06:49:43AM +0200, Frank Heckenbach wrote:
I've uploaded a new alpha to <http://www.gnu-pascal.de/alpha/>. [...]
* `pow' and `**' are EP conformant now (in particular `x pow y = (1 div x) pow (Ây)' if `y' is negative and `x <> 0') (fjf908.pas)
According to the standard, `x pow y' and `x ** y' should be an error if x = 0 and y <= 0 (in fact, there is no sensible value to return in these cases). This (mostly) worked in the old implementation, but it doesn't any more.
Unless I'm missing something, the standard seems to contradict itself: : 6.8.3.2 : : [...] : : A factor of the form x**y shall be an error if x is zero and y is less than : or equal to zero. Like you say. : A factor of the form x**y, where x is of integerÂtype or : realÂtype, shall be an error if x is negative; otherwise, the : value of x**y shall be zero if x is zero, else [...] Like I implemented it. (Note that there's no "otherwise" at the beginning of the 2nd paragraph.) : The value of a factor of the form x**y, where x is of complexÂtype, shall : be zero if x is zero, [...] Same here. : A factor of the form x pow y shall be an error if x is zero and y is less : than or equal to zero. : : The value of a factor of the form x pow y, where x is of integerÂtype, : shall be zero if x is zero, [...] Again. Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707