Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
D

dbytz

@dbytz
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Float problems
    D dbytz

    No, I don't think that I'll use decimal, espcially since I was worried that converting the int to a float every thime the window was invalidate would be too expensive (a few second later I figured out that I could store both -- do the math on the int and convert to float whe the scale changes.) I guess the major question is why when you write a prog in C/C++ do you get the "right"/expexted answer and in C# you don't. Ah well, if it still bothers me tommorrow I may take a journey down assembly lane and look at the disassembly for the C code. Another thing I was considering checking is to simply assign various values to a float an view the results...

    C# help question

  • Float problems
    D dbytz

    I'd have to read the IEEE754 spec to see why it's different than normal FP calculations, i.e. the same calcutions in C/C++ work fine with floats, but are way off with both floats and doubles in C#. I understand the internal FP representation, but I haven't seen this bad/apperant/annoying of a problem for some years, hmmm maybe somewhat over a decade or more....

    C# help question

  • Float problems
    D dbytz

    Thanks. I had considered the integer solution, it will work for the case outlined but if the scalinng capability is expanded to include "To width" etc... it may not not work as well, though I may be able to adjust the precision to account for those situtations.

    C# help question

  • Float problems
    D dbytz

    I'm using a float to keep track of a scale factor -- sounds easy enough. When the user clicks a button I either add or subtract 0.10F from the scale value (it starts at 1.0F). After several iterations I start to see the value varing by a small amount i.e instead of 0.80 I get .7999. This seems like a large error for a simple addition or subtraction operation... Any insights?

    C# help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups