| 869 | |
| 870 | template <class T1, class T2> |
| 871 | inline T1 SaturatingSubtract(T1 a, T2 b) |
| 872 | { |
| 873 | TAOCRYPT_COMPILE_ASSERT_INSTANCE(T1(-1)>0, 0); // T1 is unsigned type |
| 874 | TAOCRYPT_COMPILE_ASSERT_INSTANCE(T2(-1)>0, 1); // T2 is unsigned type |
| 875 | return T1((a > b) ? (a - b) : 0); |
| 876 | } |
| 877 | |
| 878 | |
| 879 | // declares |
no outgoing calls
no test coverage detected