/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / floating point bugg?

Username:     
Password:     
             

Forum

# 1   2009-03-14 14:55:16 floating point bugg?

sima
Member
Registered: 2008-12-10
Posts: 16

floating point bugg?

What's happening here?

    float x, y, z;
   
    x = 843314856.53262618491243641555602;
    y = 1.0/536870912.0;

    z = x*y;

I see the following values in the debugger window (using SIM-ARM):

x = 8.43315e+08
y = 1.86265e-09
z = 6.70968e-39 <----- Error, should eveluete to 1.57080068475000

Offline

 

# 2   2009-03-15 11:27:54 floating point bugg?

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: floating point bugg?

we'll check. At a first sight, it would be a bug in the instruction- set simulator. Because the hw debug is quite powewrfull with the Cortex-M3, we generally recommend not using the softwware simulator.

Offline

 

# 3   2009-03-15 19:25:30 floating point bugg?

sima
Member
Registered: 2008-12-10
Posts: 16

Re: floating point bugg?

I tried some floating point functions at home where I don't have any hardware (this was when I saw the bug). I'll try the code in hardware tomorrow.

Offline

 

# 4   2009-03-16 07:43:11 floating point bugg?

sima
Member
Registered: 2008-12-10
Posts: 16

Re: floating point bugg?

It worked when I debugged the code in hardware today.

Offline

 

Board footer