Skip to content

Commit

Permalink
Update specifications.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdcvlsc committed Oct 20, 2023
1 parent f443507 commit ac013bc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/specifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ output of python's modulo.

$$remainder = a - b \lfloor a/b\rfloor$$

To achieve a python similar modulo result in C++ we can use this operation instead:

```c++
template<typename T>
constexpr T mod(T num, T mod) {
return ((num % mod) + mod) % mod;
}
```
-----

[**Go Back to Docs**](./docs.md)
[**Go Back to Docs**](./docs.md)

0 comments on commit ac013bc

Please sign in to comment.