play around with division

master
neingeist 10 years ago
parent e14177b097
commit cae45c8613

1
.gitignore vendored

@ -20,3 +20,4 @@ bad_alloc
rtti
future
return-type-deduction
division

@ -18,6 +18,7 @@ add_executable(classes classes.cpp)
add_executable(lvalues lvalues.cpp)
add_executable(bad_alloc bad_alloc.cpp)
add_executable(rtti rtti.cpp)
add_executable(division division.cpp)
add_executable(future future.cpp)
set_target_properties(future PROPERTIES LINK_FLAGS "-pthread")

@ -0,0 +1,18 @@
#include <cassert>
#include <iostream>
int main() {
assert(0/2 == 0);
assert(1/2 == 0);
assert(2/2 == 1);
assert(3/2 == 1);
assert(4/2 == 2);
assert(5/2 == 2);
assert(0.0/2 == 0);
assert(1.0/2 == 0.5);
assert(2.0/2 == 1);
assert(2.0/2 == 1.0);
std::cout << "divided we stand." << std::endl;
}
Loading…
Cancel
Save