Changeset aefdccd in mainline for common/include/adt/gcdlcm.h


Ignore:
Timestamp:
2025-10-20T06:14:54Z (7 weeks ago)
Author:
GitHub <noreply@…>
Parents:
adbd7e1 (diff), 3e41cc4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
boba-buba <120932204+boba-buba@…> (2025-10-20 06:14:54)
git-committer:
GitHub <noreply@…> (2025-10-20 06:14:54)
Message:

Merge branch 'HelenOS:master' into ticket/packet-capture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/include/adt/gcdlcm.h

    radbd7e1 raefdccd  
    4242        static inline type name(type a, type b) \
    4343        { \
    44                 if (a == 0) \
    45                         return b; \
    46                  \
    4744                while (b != 0) { \
    48                         if (a > b) \
    49                                 a -= b; \
    50                         else \
    51                                 b -= a; \
     45                        type remainder = a % b; \
     46                        a = b; \
     47                        b = remainder; \
    5248                } \
    5349                 \
     
    5854        static inline type name(type a, type b) \
    5955        { \
    60                 return (a * b) / gcd(a, b); \
     56                return (a / gcd(a, b)) * b; \
    6157        }
    6258
Note: See TracChangeset for help on using the changeset viewer.