Hopeless Geek

Tagline

You’re twisted and perverted. I like that in a person.

Home » Blogs » Adam Knight's blog

Verizon: Really Bad at Math


  • Crap Tech
  • Fun/Humor
  • Internet & Web
  • Programming
July 7, 2006 - 11:12pm

So I’m investigating leaving Sprint after the news of the previous entry, and this doesn’t inspire confidence in the brand for Verizon.

Verizon page showing a rounding error in the price

One would think to place basic computational arithmetic well within the realm of web monkeys that can make a web store for a multi-billion-dollar communications giant. One would also, apparently, be quite wrong.

Exactly how do you pay someone 10^-14^th of a penny?

  • Adam Knight's blog
  • Printer-friendly version
July 8, 2006 - 5:07am
zimmerleut@drup... said

Well, it’s actually a 10^-12^th of a penny. That might be easier. Ask your favourite bank to consider issuing micropayment banknotes.

December 8, 2006 - 7:22pm
Adam Knight said

I’m not the guy in the Digg story. Please read.

December 9, 2006 - 10:04am
slamb said

Typical mistake – they are representing the prices with IEEE 754 doubles (base-2 floating point numbers with 52 bits of mantissa). The good news is that it’s probably limited to their web form. Their real billing system probably does things correctly.

The details: Just as numbers like 1/3rd can’t be represented in base-10 without infinitely repeating numbers, 0.1 can’t be represented in base-2. They’ve only allocated a finite number of digits to represent the number, so at some point they have to round. That point is at 52 bits, or about 10^-15th of the whole. The proper way to represent dollar amounts is fixed-precision base-10 numbers, but…well, sadly, many don’t. Very few people actually understand floating point numbers, and most people aren’t even aware that they don’t understand them.

Syndicate content Syndicate content

Site Navigation

  • Home
  • Recent
  • Popular
    • Today
  • Top rated
    • Recent votes
  • Elsewhere
    • FriendFeed
    • Friends
    • Software
    • Unsane

Navigation

  • My votes

Quotes

“Men invent new ideals because they dare not attempt old ideals. They look forward with enthusiasm, because they are afraid to look back.” — What’s Wrong With The World, 1910 – G. K. Chesterton

Footer Links

  • Badges
  • Contact
Powered by Drupal, an open source content management system
© Adam Knight, All Rights Reserved except where otherwise noted.