S-2 Level -2A products NDVI values from SNAP is different than the external calculation

When I use SNAP’s NDVI processor and Band Math I obtain different values than the calculation in Matlab (or Python) after exporting the necessary bands. SNAP applies corrections during the calculation and I’d like to know what those corrections are. I assume NDVI values obtained in SNAP are the correct ones, then it doesn’t give the user an option to use any other tool or programming language for robust analysis. I couldn’t find documentation that clearly describes the algorithm behind it.