OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [newlib/] [newlib/] [newlib/] [libc/] [stdlib/] [ldiv.c] - Diff between revs 39 and 56

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 39 Rev 56
Line 96... Line 96...
        /* see div.c for comments */
        /* see div.c for comments */
 
 
        r.quot = num / denom;
        r.quot = num / denom;
        r.rem = num % denom;
        r.rem = num % denom;
        if (num >= 0 && r.rem < 0) {
        if (num >= 0 && r.rem < 0) {
                r.quot++;
                ++r.quot;
                r.rem -= denom;
                r.rem -= denom;
        }
        }
 
        else if (num < 0 && r.rem > 0) {
 
                --r.quot;
 
                r.rem += denom;
 
        }
        return (r);
        return (r);
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.