Use round, rem and mod functions in CSS
Hare-Niemeyer aka. Hamilton or largest remainder method for seat distribution used in multiple parliamentary elections all over the world
A powerful and easy-to-use JavaScript library that brings a wide range of mathematical functionalities under one roof.