Counts pregnancy from the first day of the last period as week 0, day 0, and gives the weeks elapsed. The due date is 280 days on, by Naegele's rule. A cycle longer or shorter than 28 days shifts the date by the difference.
Pregnancy is counted from the first day of the last period rather than from conception. That day is week 0, day 0, and the weeks follow from dividing the days elapsed by 7.
This is Naegele's rule, and 280 days is 40 weeks. For a cycle longer or shorter than 28 days, ovulation shifts by the difference and the due date shifts with it.
Nobody knows the day they conceived. The first day of the last period is on record, so counting starts there. Conception is generally placed around week 2, which means nobody is actually pregnant during week 0.
On day 100, remainder 2, so the pregnancy is at 14 weeks and 2 days. The due date is days away, with 35.7% of the term behind. On a 35-day cycle the due date falls at 287 days, leaving 187.
A due date is an estimate. Only a few per cent of births fall on it, with a spread of roughly a fortnight either side.
In practice the date is revised from ultrasound measurements of the baby. This calculation is the starting estimate before that.