<br><br><div class="gmail_quote">On Mon, Oct 17, 2011 at 8:05 PM, Tyson Whitehead <span dir="ltr">&lt;<a href="mailto:twhitehead@gmail.com">twhitehead@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On October 13, 2011 18:47:48 Paterson, Ross wrote:<br>
<br>
&gt; Fractional would be superfluous, but people would probably still want<br>
&gt; to overload abs, signum, toRational, quot, rem and toInteger for the<br>
&gt; standard numeric types.  Maybe the classes would have different names.<br>
<br>
Thanks for getting back to me on this Ross.  I was also wondering about<br>
putting fromInteger and fromRational in Ring and Field.<br>
<br>
I would have imagined that not all rings and fields would have reasonable<br>
injections from the set of integers and rational numbers.<br>
<br>
Is this not the case?<br>
<br>
Thanks!  -Tyson<br></blockquote><div><br>Rings with unity have a canonical map, actually a ring homomorphism (but not <br>necessarily injection) from the integers, namely for the natural integer N, you <br>add together the unit element with itself N times. For negative N, you take the <br>
additive inverse.<br><br>For fields, you would try to extend this to rationals; however, it seems that because<br>of the non-injectivity of the above, this won&#39;t always work. Example: finite fields.<br>In a finite field of order P, we would have f(N/P) = f(N)/f(P) = f(N)/0 which is not defined.<br>
<br>So, unless I made some stupid mistake, fromInteger in Ring is OK, but<br>fromRational in Field is not.<br><br>However it probably would make sense to separate rings with unity from<br>rings without unity, and put fromInteger in the former class.<br>
<br>Balazs<br><br><br></div></div>