Motzkin numbers: Difference between revisions
Content added Content deleted
(Added missing </lang>) |
m (→{{header|Phix}}: made it a separate native section) |
||
Line 450: | Line 450: | ||
41 192,137,918,101,841,817 |
41 192,137,918,101,841,817 |
||
</pre> |
</pre> |
||
===native=== |
|||
Alternative. Note that M[37] happens by chance to be correct under 32-bit and p2js, even though |
|||
Normally I'd start with this simpler and perfectly valid 64-bit code, but at the moment am somewhat biased towards things that run online, without limiting things as this does.<br> |
|||
an intermediate value exceeds precision (in this case being rounded to the nearest whole multiple |
|||
of 16), and the final divide by (i+1) results in |
Note that, under 32-bit and p2js, M[37] happens only by chance to be correct: an intermediate value exceeds precision (in this case being rounded to the nearest multiple of 16), and the final divide by (i+1) results in an integer simply because there isn't enough precision to hold any fractional part. |
||
⚫ | |||
precision to hold any decimal places. |
|||
⚫ | |||
<!--<lang Phix>(phixonline)--> |
<!--<lang Phix>(phixonline)--> |
||
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span> |
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span> |