2009-06-27から1日間の記事一覧
#include <iostream> #include <cmath> // for fmod float roundDegree(float x) { if (x >= 0.f) { return fmod(x, 360.f); } else { return 360.f - fmod(-x, 360.f); } return x; } int main() { std::cout << roundDegree(10.f) << std::endl << roundDegree(120.30f) << </cmath></iostream>…