Urgent.News

What's breaking now, across thousands of outlets.

More in Tech

Why Does 0.1 + 0.2 Not Equal 0.3 in Python?

Open Python and type this: print ( 0.1 + 0.2 ) You'd expect 0.3 . Python gives you this: 0.30000000000000004 And it gets stranger: print ( 0.1 + 0.2 == 0.3 ) False If you're learning to code, this is…

  • Python displays 0.30000000000000004 instead of 0.3 when adding 0.1 and 0.2
  • Computers use binary system, unable to precisely represent decimal numbers like 0.1
  • Strategies to handle floating-point issues: rounding, tolerance comparison, using Decimal module

377 SQL checks on 4.6 million generated rows: what they caught

In part 1 I showed the method: write every rule about your data as a sentence, then one SQL query that counts the rows breaking it. The rule holds when the query returns 0.

  • Author ran 377 SQL checks across 4.6 million generated rows
  • Identified issues like clustering of dates and unrealistic data counts
  • Explicitly written rules helped catch intended data problems

More from Thursday 5 November →