Add Scalar takes the Main Input connection and adds it to the Input 2 connection and passes the result to the Output.
Notice that the displacement from the Power Fractals has been stripped away and only the grey scalar value has been used in the output. If you want to add displacements together then the Merge Shader would be the node to use.
If Input 2 is disconnected, the Main Input passes through to the Output, again without the displacement, only the scalar grey value.
If the Main Input is disconnected, nothing passes through.
If you connect two colour sources, the Add Scalar node will take the luminance of the colour channels of each input to create a grey scale map of the inputs brightness and then add them together, ignoring the colour information. The maths being luminance = 0.2125 * r + 0.7152 * g + 0.0724 * b
If you connect vector sources to the inputs, the node will look at the length the vector makes from a zero origin to produce a scalar value. The internal maths to do this is the square_root(x*x + y*y + z*z).
The preview panel can only show values up to 2 (the Preview Panel is set this way to see overlaid graphics), so the pure white areas have values beyond 2 in this example. There is no restriction to the size of the number being affected.
If there's any errors, omissions or questions about the above, please leave a comment below.
Wiki link: https://planetside.co.uk/wiki/index.php?title=Add_Scalar
This is a great introduction.
When a colour is converted to a scalar, it uses the "luminance" of the colour using the following: luminance = 0.2125 * r + 0.7152 * g + 0.0724 * b
When a vector is converted to a scalar, it uses square_root(x*x + y*y + z*z), which is the length of the vector.