Skip to content

Instantly share code, notes, and snippets.

@usagi
Created February 18, 2014 09:55
Show Gist options
  • Select an option

  • Save usagi/9067820 to your computer and use it in GitHub Desktop.

Select an option

Save usagi/9067820 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cmath>
int main()
{
for(auto n = 0; n < 100; ++n)
{
float t = float(n) / 100;
float f = 2.f;
float a = 4.f * std::floor(t * f) - 2.f * std::floor(2.f * t * f) + 1.f;
std::cout << t << " : " << a << "\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment