R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

I have two fractions I want to find the "MOD" between them. Is the answer another fraction?

I chose: Since integer mod is sort of the opposite of integer division. I found the mod of the first fractions numerator and denominator and arbitrarily assigned it as the numerator of the new fraction The same for the second fraction and assigned to the denominator of the new fraction.

Both fractions have already been through euclid's algorithm and are in GCD form.

I have seen many trying to explain it in the terms of ax + by = d or something like that. What are the variables as they relate to the fractions. Is this even the correct direction?

I chose: Since integer mod is sort of the opposite of integer division. I found the mod of the first fractions numerator and denominator and arbitrarily assigned it as the numerator of the new fraction The same for the second fraction and assigned to the denominator of the new fraction.

Both fractions have already been through euclid's algorithm and are in GCD form.

I have seen many trying to explain it in the terms of ax + by = d or something like that. What are the variables as they relate to the fractions. Is this even the correct direction?

Do more with

EXPERT OFFICE^{®} is a registered trademark of EXPERTS EXCHANGE^{®}

If they are in GCD form, it seems that the MOD should be the MOD of the numerators, then divided by the denominator. That is:

(a/x) MOD (b/x) = (a MOD b)/x

Keep in mind that this is my take on the matter,withouto a proper reference to back it up.

What am I using this number for?

How does my extended definition fulfill that function?

Is the definition consistent with that for integer arguments?

In short there is no one way of defining this number.

there is no one way of definingA Mod B even for integers, especially when you consider computer implementations, but I would argue that the most sensible definition is the one espoused by Graham, Knuth, and Patashnik.

Operands of modulus are converted to integers (by stripping the decimal part) before processing.

And from http://msdn.microsoft.com/en-us/library/basszbdt%28v=vs.84%29.aspx

If number1 or number2 are floating point numbers, they are first rounded to integers.

At least in Firefox, javascript will accept entries with decimal fractions.

= a/x - (b/y)*floor((y*a)/(x*b))

= ((y*a)/(x*y) - (x*b)/(x*y)*floor((y*a)/(x

= (y*a - x*b*floor((y*a)/(x*b)))/(x

= (y*a MOD x*b) / (x*y)

so, yes.

One can consider a MOD operation as choosing a member of a field. In a MOD b, b is a number of elements, ie: the field, and we start with the first field member and count "a" elements going around in a ring, thus picking out on element in b.

In the case of fractions, b/y has to represent a field of elements. Since a/x is going to be the maximum value for the counter, the question arises as to what is the value of one element. That must be 1/xy, since xy is a number which both x and y divide. Thus again one counts a elements in the field b/y of elements of value 1/xy in a ring.

## Premium Content

You need an Expert Office subscription to comment.Start Free Trial