NOTA: You can also write dates before Christ, by using negative numbers, as the following examples:
1 b.C. = 0; 2 b.C. = -1; 44 b.C. = -43; etc. However, the result cannot be exact for periods before the Julian reform of 46 b.C.
I got the algorithm from the function to calculate the Julian number offered by Claus Tondering in his web site (par. 2.15.1).