Simple assembly code conversion to Java -


I want to convert the following code to a Java code. I think this is the assembly code, but it is not sure. The part I really do not get is y - = m . {0, 3, 5, 1, 4, 6, 2, 5, 6, 2, 4}; Y - = M & lt; 3; Return (y + y / 4 - y / 100 + y / 400 + t [M-1] + D)% 7;

This is a code, and I believe

< Pre> constant final integer [] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}; Static int dow (int y, int m, int d) {if (m & lt; 3) {y--; } Return (y + y / 4 - y / 100 + y / 400 + t [m - 1] + d)% 7; }

is equivalent because y - = m Assessment y- = 1; if m otherwise y- = 0; Instead you can use a simple if in the end t [] can not be static in a method in java.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -