How many days can you be outside of Japan – how is “in a year” calculated?

I understand that the general unofficial rule is that foreign residents should not exceed 90 days per trip and/or ~100 days per year spent outside of Japan if they want to maintain their residency for future PR purposes.

I'm curious about how "in a year" is calculated, all of the resources I have looked at have never specified.

Is it in a calendar year? In the Japanese fiscal year? A year from the date of the first departure within a 365-day period?

I'd be grateful for any information and sources for this, thank you!

by lover_of_language