473,396 Members | 1,942 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,396 software developers and data experts.

Precission of Double chaged after init DirectX device

I am very confused with the rezult of this code:

PresentParameters pps = new PresentParameters();
pps.Windowed = true;
pps.SwapEffect = SwapEffect.Discard;

double aMixX = 68665.3515;
double aStepX = 0.2855;

double aX1 = aMixX - aStepX;

Device m_device = new Device(0, DeviceType.Hardware, this, CreateFlags.HardwareVertexProcessing, pps);

double aX2 = aMixX - aStepX;
Console.WriteLine(aX1-aX2); // returns 0.00350000010803342

I use DirectX v1.1.4322 and dot.net 1.1?
Can anyone help me with suggestion?
Nov 29 '07 #1
2 1176
I am very confused with the rezult of this code:

PresentParameters pps = new PresentParameters();
pps.Windowed = true;
pps.SwapEffect = SwapEffect.Discard;

double aMixX = 68665.3515;
double aStepX = 0.2855;

double aX1 = aMixX - aStepX;

Device m_device = new Device(0, DeviceType.Hardware, this, CreateFlags.HardwareVertexProcessing, pps);

double aX2 = aMixX - aStepX;
Console.WriteLine(aX1-aX2); // returns 0.00350000010803342

I use DirectX v1.1.4322 and dot.net 1.1?
Can anyone help me with suggestion?
Nov 29 '07 #2
Plater
7,872 Expert 4TB
Your two threads have been merged. In the future, please refrain from double posting.


Very strange.

Is there any difference if you ran this code?

Expand|Select|Wrap|Line Numbers
  1. double aMixX = 68665.3515;
  2. double aStepX = 0.2855;
  3.  
  4. double aX1 = aMixX - aStepX;
  5. double aX2 = aMixX - aStepX;
  6.  
  7. Console.WriteLine(aX1-aX2);
  8.  
Without the directx calls?
Nov 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Aaron Lovi | last post by:
Hi, I'm a noob trying to use managed DirectX (VC# 2003, DX9.0 Apr 2005 SDK). I used to use OpenGL with QT and VC++6.0, but I was a relative newcomer to that as well. When I used OpenGL, my...
1
by: cprog84 | last post by:
I'm getting the following error when I run the mostly unmodified DX SDK texture tutorial code in SharpDevelop: System.NullReferenceException: Object reference not set to an instance of an...
4
by: Zoury | last post by:
look up your timezome settings... you have future posted.
2
by: emr | last post by:
Hi, just downloaded DirectX SDK (latest one) and found an example but it doesn't work. So any1 can tell me what the heck is with the Main() method what did this guy do? Thanks. using System; ...
0
by: Harvey Cohen | last post by:
Hello all, I have some C# code that implements calls to DirectX.DirectSound. It compiles under both VS .NET 2003 and VS 2005 and runs under VS .NET 2003 and VS 2005 on a Compaq laptop (Windows...
1
by: A. Gaubatz | last post by:
I am using some code that I somewhat cannibalized from a tutorial, and whenever I try to put in an image not of specific seemingly random sizes, it stretches them out alot. The module that runs...
0
by: Jovo Mirkovic | last post by:
Hi, Any Windows action which minimizes all windows (win + D, ctrl + alt + del) is causing program error I have two forms: Form1 is shown on primary monitor on dual head graphics display
5
by: Vibhesh | last post by:
I am facing problem with TimeSpan structure when DirectX is used. Following is the sample code that causes the problem: ...
4
by: Jax50 | last post by:
Hello, i'm trying to find the best way to init in c++, i'v tryed pointing _HAL -_REF&32... what is better? (i'm using the most simple init possible) void initD3D(HWND hWnd) { d3d =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.