# How to compute dBFS from rms-values if the samples exceed 32bits

For a first approach on audio-sampling I'm currently working with the raspberry pi's pcm pins and MEMS-microphones, using the ALSA library.

A problem arises when I want to calculate dBFS from a buffer's rms-value because i have to assume that a sample can be as big as (2^32)/2. In order to obtain rms, I would have to square every single sample, some of which might not be computable due to their size.

What would be a good way of obataining the dBFS of a finite array of discrete values without causing overflows?

4. Scale the numbers by $$2^{-16}$$ (arithmetic right shift by 16-bits) before squaring.