#include <stdio.h>
#include <math.h>
#include <stdint.h>
#include <inttypes.h>

int main ()
{
    int m = 10000;
    for (uint32_t l = 100; l != 0; l++) {
        // Let's figure out how to split 'l' into parts no larger than 'm'.
        // Yes, integer division would be better suited here, but for the
        // sake of argument we use float.
        uint32_t n = ceilf((float)l / (float)m);
        
        /* This version works correctly. The factor to use depends on the
         * range of 'm' and 'l'.
         */
        //uint32_t n = ceilf(1.000001 * ((float)l / (float)m));
        
        if (n * m < l) {
            // We choose to little segments.
            // One will have too be larger than 'm'.
            printf("Oops l=%" PRIu32 " n=%" PRIu32 "\n", l, n);
        }
    }
}
