#include <iostream>
#include <math.h>
#include <stdlib.h>
int main() {
  double rule_spacing = 0.05;
  // These are the highlighted rules - currently it should be every 2nd rule
  double important_steps = rule_spacing*2.0;
  // Getting the stard draw offset which should be bellow bottom graph corner
  double start = 105.6;
  double maxYValue = 106.149;
  std::cout<<"Legend from "<<start<<" to "<<maxYValue<<" by "<<rule_spacing<<", important_steps: "<<important_steps<<'\n';
  //Loop until on top
  while(start <= maxYValue) {
    //double remainder = fmod(start, important_steps);
    float quotient = start / important_steps;
    int quot_int = round(quotient);
    std::cout<<"        "<<" legend with marker "<<start<<" Marker remainder:"<<abs(quotient - quot_int)<<'\n';
    //if(remainder==0 || remainder==important_steps || remainder<important_steps/1000.0) {
    if (abs(quotient - quot_int) < 1e-10) {
      std::cout<<"          BIG RULE!"<<'\n';
    }
    else
      std::cout<<"          small rule."<<'\n';
    start+=rule_spacing;
  }
}