Help

No prob. now i get it. thank you Jeff.

I like that code Jeff. I’m only having trouble with the Remainder only showing result of 0 no matter what i input.

Add this line after nWraps = nBights - nGCD

nRemainder =nParts mod nBights

Its 0 because I didnt use a new variable inside the GCD bit

Thank you Jeff. That works. All numbers are working properly.

I had to implement this into a project of mine; so I thought I’d share the code I used. It has no safety checking so you may want to validate the values before you use this function.

Public Function GCD(A as integer, B as Integer) as integer Dim r as integer = a - ( b * floor( a / b ) ) return if( r = 0, b, GCD( b, r ) ) End Function

It may not be mathematically correct, but it returns the values I expect it to :slight_smile: