19.11.2014 Views

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

25.1.5 opr −(self,other: Q): Q<br />

<strong>The</strong> binary subtraction operator − returns the difference of its arguments, which is equal to the sum of (a) the first<br />

argument and (b) the negation of the second argument.<br />

25.1.6 opr ·(self,other: Q): Q<br />

25.1.7 opr ×(self,other: Q): Q<br />

<strong>The</strong> multiplication operator · returns the product of its arguments. <strong>The</strong> multiplication operator × does exactly the<br />

same thing.<br />

For types Q ∗ and Q # , the product of 0/0 and any rational value is 0/0 , and the product of zero and an infinity<br />

(regardless of sign) is 0/0 ; the product of an infinity and any rational value other than zero and 0/0 is an infinity<br />

whose sign is positive if and only if the two arguments have the same sign.<br />

25.1.8 opr /(self): Q ∗<br />

<strong>The</strong> unary reciprocal operator / returns the reciprocal of its argument. <strong>The</strong> reciprocal of zero is +∞ (and therefore<br />

the result type of / when given an arguments of type Q is necessarily Q ∗ ).<br />

For types Q ∗ and Q # , the reciprocal of either +∞ or −∞ is zero, and the reciprocal of 0/0 is 0/0 .<br />

25.1.9 opr /(self,other: Q): Q ∗<br />

<strong>The</strong> binary division operator / returns the quotient of its arguments, which is equal to the product of (a) the first<br />

argument and (b) the reciprocal of the second argument.<br />

25.1.10 opr _(self,power: Z): Q #<br />

Exponentiation of a rational number to an integer power produces a rational result. If the power is 0 , then the result<br />

is always 1 , even if the rational number base is 0 (this definition is somewhat arbitrary but is computationally useful).<br />

property ∀(x, y : Z) x y = 1/(x −y )<br />

property ∀(x, y : Z) x y = x ( ⌊y/2⌋)x ( ⌈y/2⌉)<br />

196

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!