Quantcast
Channel: Comparing Fortran & C++ assembler for int = floor(sqrt(...)) - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Peter Cordes for Comparing Fortran & C++ assembler for int =...

As @EOF explained, always use -fno-math-errno, and use -march=native if you can, or at least -msse4 if you don't need the binary to run on old machines like first-gen Core 2, or AMD Phenom II....

View Article



Answer by EOF for Comparing Fortran & C++ assembler for int = floor(sqrt(...))

TL;DR: You're hobbled by bad defaults and compatibility with obsolete machines: Bad defaults are gcc setting errno for floating-point computations (despite this not being required by the C language),...

View Article

Comparing Fortran & C++ assembler for int = floor(sqrt(...))

I have implemented a function in Fortran and C++ each:#include <math.h>void dbl_sqrt_c(double *x, double *y){ *y = sqrt(*x - 1.0); return;}pure subroutine my_dbl_sqrt(x,y) bind(c,...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images