NOTE: 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. The result could be not exact for periods before 15 A.D., and surely not 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.