subtract

Subtract any two numbers

subtract<return_type>(a, b);

will return the difference of the two given numbers. The return_type specifies in which data type the difference will be returned in, like shown in below example:

subtract<int>(6.9, 4.20); //2
subtract<float>(3.222, 5); //-1.778
subtract<bool>(0, 1); //1
------------------------
subtract<char>('c', 2); //'a'

Last updated