Multiplying floats

  • Thread starter Thread starter k
  • Start date Start date
K

k

I have aproblem when multiplying 2 float

638.9 * 382.8 should = 244570.92

results giving 244570.922

both numbers are float variables , tried using double to much the same
effect ..?????

any assistance much appreciated

DaveW
 
Floats will only deliver a certain precision. Try using decimals instead.

--
Bob Powell [MVP]
Visual C#, System.Drawing

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
 
Back
Top