-<span class=grvsc-line><span class=grvsc-source><span class=mtk1>List.iter </span><span class=mtk14>(</span><span class=mtk1>printfn </span><span class=mtk10>"</span><span class=mtk14>%x</span><span class=mtk10>"</span><span class=mtk14>)</span><span class=mtk1> </span><span class=mtk14>(</span><span class=mtk1>randLst </span><span class=mtk6>7</span><span class=mtk1> </span><span class=mtk6>1</span><span class=mtk14>)</span></span></span></code></pre><p>The resulting printed list of pseudo-random numbers does not work in Fable:<table><thead><tr><th align=right>Fable<th align=right>.NET<tbody><tr><td align=right>1<td align=right>1<tr><td align=right>574a<td align=right>574a<tr><td align=right>d524223<td align=right>d524223<tr><td align=right>6a89e98c<td align=right>6a89e98c<tr><td align=right>15bd0684<td align=right>15bd0685<tr><td align=right>3d8b8000<td align=right>3d8be20e<tr><td align=right>50000000<td align=right>65ba5527<tr><td align=right>0<td align=right>2458c8d0</table><h3 id=workarounds>Workarounds<a href=#workarounds aria-hidden=true tabindex=-1><span class=anchor>#</span></a></h3><ul><li>When accurate low-order bit arithmetic is needed and overflow can result in numbers larger than 2^53 use <code>int64</code>, <code>uint64</code>, which use exact 64 bits, instead of <code>int32</code>, <code>uint32</code>.<li>Alternately, truncate all arithmetic with <code>>>> 0</code> or <code>>>> 0u</code> as appropriate before numbers can get larger than 2^53: <code>let rng (s:int32) = 10001*s + 12345 >>> 0</code></ul><h3 id=printing>Printing<a href=#printing aria-hidden=true tabindex=-1><span class=anchor>#</span></a></h3><p>One small change from .NET in <code>printf</code>, <code>sprintf</code>, <code>ToString</code>. Negative signed integers are printed in hexadecimal format as sign + magnitude, in .NET they are printed as two's complement bit patterns.</div></div></section><div class="section bd-docs-pagination bd-pagination-links"><a class="button bd-fat-button is-primary is-light bd-pagination-prev" href="/docs/javascript/features.html"><i>←</i><span class="is-hidden-mobile"><em>JavaScript</em><strong>Features</strong></span></a><a class="button bd-fat-button is-primary is-light bd-pagination-next" href="/docs/typescript/build-and-run.html"><span class="is-hidden-mobile"><em>TypeScript</em><strong>Build and Run</strong></span><i>→</i></a></div></div></div></div></div><script async="" src="/resources/nacara-standard-layouts/scripts/menu.js"></script></body></html>
0 commit comments