The following sample application is supposed to floor an integer value:
#include <iostream>
#include <math.h>
int Round(double val)
{
    return val + 0.5;
}
double Round2(double val)
{
    return floor(val + 0.5);
}
int main() {
    double val1 = 16.75;
    cout << "Round 16.75: " << Round(val1) << endl;
    cout << "Round 21.60: " << Round2(21.60) << endl;
    cout << "Round 5.50: " << Round(5.50) << endl;
    cout << "Round 5.40: " << Round2(5.40) << endl;
}
On my desktop pc both function are working correct.
If I cross-compile it for my raspberry with the arm-gnueabi-toolchain (v4.7.2) and copy the compiled file on my raspberry to execute it, the function that uses the floor function always returns zero.
If I compile the application on my raspberry it works fine.
Is this a bug or am I doing something wrong?
UPDATE:
arm-linux-gnueabi-readelf -h -A stamp 
    ELF Header:
      Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
      Class:                             ELF32
      Data:                              2's complement, little endian
      Version:                           1 (current)
      OS/ABI:                            UNIX - System V
      ABI Version:                       0
      Type:                              EXEC (Executable file)
      Machine:                           ARM
      Version:                           0x1
      Entry point address:               0x8908
      Start of program headers:          52 (bytes into file)
      Start of section headers:          4852 (bytes into file)
      Flags:                             0x5000002, has entry point, Version5 EABI
      Size of this header:               52 (bytes)
      Size of program headers:           32 (bytes)
      Number of program headers:         8
      Size of section headers:           40 (bytes)
      Number of section headers:         32
      Section header string table index: 29
    Attribute Section: aeabi
    File Attributes
      Tag_CPU_name: "4T"
      Tag_CPU_arch: v4T
      Tag_ARM_ISA_use: Yes
      Tag_THUMB_ISA_use: Thumb-1
      Tag_ABI_PCS_wchar_t: 4
      Tag_ABI_FP_denormal: Needed
      Tag_ABI_FP_exceptions: Needed
      Tag_ABI_FP_number_model: IEEE 754
      Tag_ABI_align_needed: 8-byte
      Tag_ABI_align_preserved: 8-byte, except leaf SP
      Tag_ABI_enum_size: int
      Tag_DIV_use: Not allowed
Update2
It's not just the problem with double. When I try to return float I get only zeros, too.
 
     
    