Skip to content
Snippets Groups Projects

ex01 feedback added

Merged amitjans requested to merge feedback into main
3 files
+ 26
2
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 13
2
/*
Pascal: Looks good to me, albeit not necessarily precise.
Note that python's import is very different from preprocessor directives.
In python, there is a whole import machinery, while the #include directive
merely instructs the preprocessor to copy-paste a specific file.
Personally, I'm not a fan of 'using namespace xxx'. At the very least, you
pollute the global namespace and make it harder to keep track of where specific
functions and classes are actually coming from.
*/
// "include" is like the import in Python
#include <iostream>
// namespace allow us to group named entities into narrower scopes, that otherwise
@@ -5,7 +17,7 @@
using namespace std;
void machineEpsilon(float EPS) {
float prev_epsilon = EPS;
while ((1+EPS) != 1){
@@ -20,4 +32,3 @@ void machineEpsilon(float EPS) {
int main(){
machineEpsilon(0.5);
}
Loading