On Thu, Jul 12, 2012 at 11:01 AM, Takayuki Muranushi <span dir="ltr">&lt;<a href="mailto:muranushi@gmail.com" target="_blank">muranushi@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div id=":1nr">&gt; sunPerMars :: [Double]<br>
&gt; sunPerMars = (/) &lt;$&gt; sunMass &lt;*&gt; marsMass<br>
<br>
Sadly, this gives too many answers, and some of them are wrong because<br>
they assume different Earth mass in calculating Sun and Mars masses,<br>
which led to inconsistent calculation.</div></blockquote><div><br></div><div>I think what you want to do is factor out the Earth&#39;s mass, and do your division first:</div><div><br></div><div>&gt; sunPerMars&#39;&#39; = (/) &lt;$&gt; sunMassCoef &lt;*&gt; marsMassCoef</div>

<div><br></div><div>The mass of the earth cancels.</div><div><br></div><div>That gives a list of length 9, where your approach gave 16 distinct results. But I think that&#39;s just floating point rounding noise. Try the same monadic calculation with integers and ratios.</div>

<div><br></div><div>The moral? Using numbers in a physics calculation should be your last resort ;)</div></div>