Created
March 23, 2017 21:07
-
-
Save IceN9ne/3c52231d8ff3c42ec949fed812814799 to your computer and use it in GitHub Desktop.
Insane fibonacci generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto fibonacciSequence(int maxValue) | |
{ | |
std::vector<int> seq; | |
for (int i{0}, j{1}; i <= maxValue; j ^= i ^= j ^= i += j) | |
seq.push_back(i); | |
return seq; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment