Anonymous user
Metallic ratios: Difference between revisions
→{{header|C++}}: improvements
m (→{{header|C++|}}: Typo) |
(→{{header|C++}}: improvements) |
||
Line 235:
#include <iostream>
template<const uint N>
void lucas(ulong
std::cout << "Lucas sequence for " << names[
auto x0 = 1L, x1 = 1L;
std::cout << x0 << ", " << x1;
for (auto i = 1u; i <= N - 1 - 1; i++) {
auto x2 =
std::cout << ", " << x2;
x0 = x1;
Line 251:
}
template<const
void metallic(ulong b) {
using namespace boost::multiprecision;
using
for (auto i = 0u;;) {
i++;
auto thiz =
if (prev == thiz) {
std::cout << "Value after " << i << " iteration" << (i == 1 ? ": " : "s: ") << thiz << std::endl << std::endl;
|