Triangular numbers: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (Minor rephrasing to be more correct) |
m (→{{header|Julia}}: precision -> 18) |
||
Line 402: | Line 402: | ||
function tetrahedral_root(x) |
function tetrahedral_root(x) |
||
return Float64(round((3x + sqrt(9 * |
return Float64(round((3x + sqrt(9 * x^big"2" - big"1"/27))^(big"1"/3) + |
||
(3x - sqrt(9 * |
(3x - sqrt(9 * x^big"2" - big"1"/27))^(big"1"/3) - 1, digits=18)) |
||
end |
end |
||
Line 460: | Line 460: | ||
Roots of 21408696: |
Roots of 21408696: |
||
triangular-root: 6543.0 |
triangular-root: 6543.0 |
||
tetrahedral-root: 503. |
tetrahedral-root: 503.5618269746365 |
||
pentatopic-root: 149.06094737526587 |
pentatopic-root: 149.06094737526587 |
||
Line 470: | Line 470: | ||
Roots of 14545501785001: |
Roots of 14545501785001: |
||
triangular-root: 5.3936071581451725e6 |
triangular-root: 5.3936071581451725e6 |
||
tetrahedral-root: 44355. |
tetrahedral-root: 44355.777384073255 |
||
pentatopic-root: 4321.0 |
pentatopic-root: 4321.0 |
||
</pre> |
</pre> |