comp.lang.ada
 help / color / mirror / Atom feed
* Ammunition for strong typing...
@ 2009-07-20  7:49 Jean-Pierre Rosen
  0 siblings, 0 replies; only message in thread
From: Jean-Pierre Rosen @ 2009-07-20  7:49 UTC (permalink / raw)


Seen on SlashDot
(http://it.slashdot.org/story/09/07/15/2050215/Software-Glitch-Leads-To-23148855308184500-Visa-Charges?from=rss)

Recently several Visa card holders were, um, overcharged for certain
purchases, to the tune of $23,148,855,308,184,500.00 on a single charge.
The company says it was due to a programming error, and that the problem
has been corrected. What is interesting is that the amount charged
actually reveals the type of programming error that caused the problem.
23,148,855,308,184,500.00 * 100 (I'm guessing this is how the number is
actually stored) is 2314885530818450000. Convert 2314885530818450000 to
hexadecimal, and you end up with 20 20 20 20 20 20 12 50. Most C/C++
programmers see the error now ... hex 20 is a space. So spaces were
stuffed into a field where binary zero should have been.
-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-20  7:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-20  7:49 Ammunition for strong typing Jean-Pierre Rosen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox