Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- #define DIV (rand() - 1) / 32766.0 // defining a macro - everytime when we put DIV, it's replaced by this formula (rand() - 1) / 32766.0
- using namespace std;
- int main()
- {
- srand(time(nullptr));
- double x = DIV;
- cout << x << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement