I am trying to calculate the GCD of two numbers via the Euclidean method, and noticed weird behavior. Although I am passing the value of the number to the function, the numbers are modified by the function for numbers with low number of bits (usually less than 64). Could anyone clarify if this is a mistake on my behalf or is it expected behavior? You can check the code in the playground here: Golang playground example
I thought the expected behavior is that no values should be changed by passing them to my functions. Thanks for any help, I couldn't find any other occurrences like this in the last day of searching.