13

Can anyone explain why, in the .NET framework, there are PointF structures (using the single-precision float type) and no "PointD" (using the double-precision double type)?

Did they establish that such precision would never make sense in the System.Drawing namespace? Is there any other reason?

mskfisher
  • 3,291
  • 4
  • 35
  • 48
Fueled
  • 8,776
  • 9
  • 29
  • 31
  • I guess a maybe upcoming migration to double precision in drawing would not legitimate twice the consumption of storage space at the time of writing this decently guessed explanation. :-) But I understand what you mean. In the maybe not so far future we might need double precision, as we now have 8 GB of RAM, thousands of GBs of HDD space 64bit CPUs and so on... and will never have more than petabytes, will we? ;-) – Andreas Jul 07 '10 at 06:55
  • Which would be more useful: adding graphical point types with Double X and Y, or allowing implicit conversions from Double to Float? – supercat Feb 21 '12 at 23:43

1 Answers1

21

At the time when GDI+ (the technology which System.Drawing is based on) was developed, hardware was nowhere near the performance and capability of today, and a Double-based coordinate system would have imposed a heavy burden on the hardware for very little benefit on the display-end, with displays having the size and resolution that they did. Even with today's monster video cards, we are only this year seeing the ability to do double-precision floating point operations that have acceptable performance, and these are still 1/2 the speed of single-precision ops. So it was a choice of practicality to use Single types to model the graphics operations.

Today, with WPF, we have a platform which began with an eye toward the next decade or two, and so using Double to model the coordinate system made sense.

codekaizen
  • 26,990
  • 7
  • 84
  • 140