Math Node - How does it handle colour input?

I believe it is doing what the RGB to BW node does, which is: " The RGB to BW Node maps an RGB color image to a gray-scale by the luminance."

Documentation:
https://docs.blender.org/manual/en/latest/render/shader_nodes/converter/rgb_to_bw.html