AnsweredAssumed Answered

Float accuracy in VisualDSP++ does not match VisualStudio

Question asked by CraigG on May 7, 2009
Latest reply on Jun 9, 2009 by StuartS

When I run following code with VisualDSP++ and MS Visual Studio, I'm seeing different resuls.
    double d =12245001;
    d  =  d  / 1000.0;         // VisualDSP    = 12245
                               // VisualStudio = 12245.001

    long long l = 4294967296;  //this is 2^32
    d  = d *  (double)(l);     // VisualDSP    = 52598178733824
                               // VisualStudio = 52591878834487

 

It seems VisualDSP++ has an issue with float accuracy. What is wrong here?

Outcomes