473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

managed float != unmanaged float

Hello all, this is my first time here so please be gentle :-)

We have a VC++ program that does many floating point (float, notdouble) and we are seeing that the results of runs under VC6 andCV7 are the same. However, when we compile with the clr flag,the results we are getting are different in the very lowsignificant bits of the mantissa. We guess it has something todo with how the precision the CLR uses to hold floating pointnumbers.

Has anyone seen this before? Please answer here and possibly tomy email: am**@xpandsoft.com

I will post a digest of replies here...

Thanks, Amir Kolsky

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>w/kieG/LA0GTkMYt0KI/Pw==</Id>
Nov 17 '05 #1
1 1364
They are still both correct. You cannot assume that FP values will be
exactly the same between different environments. Even without involving the
CLR, you will get different results in unmanaged code depending on your
compilation options.

Ronald Laeremans
Visual C++ team

"Amir Kolsky via .NET 247" <an*******@dotnet247.com> wrote in message
news:eO**************@TK2MSFTNGP12.phx.gbl...
Hello all, this is my first time here so please be gentle :-)

We have a VC++ program that does many floating point (float, not double) and
we are seeing that the results of runs under VC6 and CV7 are the same.
However, when we compile with the clr flag, the results we are getting are
different in the very low significant bits of the mantissa. We guess it has
something to do with how the precision the CLR uses to hold floating point
numbers.

Has anyone seen this before? Please answer here and possibly to my email:
am**@xpandsoft.com

I will post a digest of replies here...

Thanks, Amir Kolsky

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>w/kieG/LA0GTkMYt0KI/Pw==</Id>
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
1
by: Eric Twietmeyer | last post by:
Hello, I'm starting to investigate cs, managed c++ and interoperating with a very large unmanaged code base. We are going to use Windows Forms (written in cs) to replace our old fashioned GUI. ...
5
by: Chris Kiechel | last post by:
I am writing a .NET Windows application and it needs to perform DDE calls to a legacy system. I created a C++ unmanaged class that performs the actual DDE connection and communication. However,...
3
by: dbru | last post by:
I need to pass an address of a Managed float array to a DLL. The following doesn't seem to work extern static float GetXXX( StringBuilder HWND, long nWhat, ref float lparam );
3
by: zhphust | last post by:
I want to convert a object of a managed class to a unmanaged structure that has the same member with that managed class. Can anybody tell me how i can do it? Thanks in advance. -- zhphust...
2
by: The unProfessional | last post by:
Any know how to convert a managed array to an unmanaged array (ptr)? // Managed float f = new float ; // Unmanaged unsafe { float *pArray = f; // No good
4
by: William F. Kinsley | last post by:
My understanding is that when I re-compile a existing MFC application with the /clr switch, that the code generated is managed(with some exceptions) but that the data isn't, i.e. not garbage...
3
by: Thorsten | last post by:
HI I'm a C# developer and unfortunately I have to write now some code in managed and unmanaged C++. In this area I'm Newbie and therefore please forgive me if this is a really simple...
9
by: Amit Dedhia | last post by:
Hi All I have a VC++ 2005 MFC application with all classes defined as unmanaged classes. I want to write my application data in xml format. Since ADO.NET has buit in functions available for...
25
by: Koliber (js) | last post by:
sorry for my not perfect english i am really f&*ckin angry in this common pattern about dispose: ////////////////////////////////////////////////////////// Public class...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.