I recently came across a problem with floating point numbers. I know there are some inherent inaccuracies, but I was surprised to find a problem with a relatively simple number.

Floats are numbers stored as two parts: a whole number and an exponent. Generally you're dealing with numbers on similar scales, i.e. millimetres or kilometres, so this makes sense.

The term "float" refers to the fact that the decimal point 'floats'. For instance the following are all different exponents with the same whole number:

  • 1.1 is 11 x 10-1
  • 0.15 is 15 x 10-2
  • 1.5 is 15 x 10-1
  • 15000.0 is 15 x 103

Simple enough, but I had a bug with 1.1 - I was getting 1.0999999999989! Odd issue until you figure in that computers think in binary. I didn't expect this to be a problem because both the value and the exponent are whole numbers. What I'd failed to realise is that the floating point was also base-2, not base-10. So the floats above are actually:

  • 1.1 is 154811237190861 x 2-47
  • 0.15 is 168884986026394 x 2-50
  • 1.5 is 3 x 2-1
  • 15000.0 is 1875 x 23

Those horrible big numbers for 0.15 and 1.1 are too big for floats to handle. The issue wasn't really the inaccuracy - I expected the float to only be able to deal with a few significant figures. What was a surprise (and shouldn't have been) was that the numbers it has problems with are not the ones I expect it to. To floats 1.1 is an irrational number.

This normally isn't a problem, for most of the sort of calculations where floating point numbers are used a this inaccuracy is worth the fact that the calculation is quicker.

0

Add a comment

And I'll tell you why...

The allegory constantly used by governments and the media is on of a household, and the recession is like the breadwinners losing their jobs. Obviously anyone sensible would cut back, yeah?

But, countries are nothing like households, and that allegory just doesn't work.

I'm not arguing that they shouldn't cut back at all, but I think a healthy government should be running some degree of deficit during a recession.

Here are my assumptions:

1. There will ALWAYS be boom and bust

We can't stop the cycle of boom and bust, it's been going for hundreds of years and will continue for hundreds more. Maybe one day, but no financial theory to date has come close to a way around them.

With that assumption we should plan for them: busts will happen. Booms will follow the busts, for a while, until it all starts again.

During a recession governments should know that, inevitably, a boom will come again. During a boom governments should know that, inevitably, the bust is coming.

2. Governments benefit from long term stability

Boom and bust is a vicious cycle and an unstable one: governments have to plan for how much money they have to spend, so instability always messes them up. They have to make guesses as to how much to spend on defence, the police, public health, welfare and so on.

All but the most extreme libertarians and neo-cons admit on the need for at least some government spending on things like fire services (you might not want to insure your neighbour's house, but if it's on fire you want it put out regardless).

A governments plans on spending are always guesses - estimates of how much taxpayers will earn and hence how much tax they will pay. A simple fact is that they'll never be 100% accurate, but you want them to be as close as possible. Another simple fact is that boom and bust make those predictions less accurate.

This means that either a deficit or a surplus is inevitable, we should expect and account for one or the the other.

3.Tax & spend are inextricably linked to government revenue

There are lots of theories as to how (and which model is best) but whether you're left or right, and whether you follow Keynes or Hayek, how much is taxed and how much is spent by governments has an effect on how much money people have and how much tax renvue the government takes.

A government cutting taxes obviously has less revenue, but what does that do to relative wealth? A government cutting spending? They have more money, but public sector employees have less money and government contractors lose business. Less tax is collected - left vs right can argue about whether that is more or less than the amount saved by the cuts, but my point is that it's unpredictable.

Nobody (including all the best economists) can actually accurately predict the relationship. However it the effect is not one that damps the boom and bust cycle - government behaviour exaggerates the booms and the busts like a binge dieter.

4. Governments should not have a large surplus

I think most people expect to be paying a fair amount of tax, and that means the government not having loads of cash left over from the tax they've collected.

Economic right wingers tend to cut taxes when there is a surplus, governments on the left tend to spend more.

Something they never seem to do is to try and save that money, partially because elections are coming up and voters want to see something short term, but also because there isn't really anywhere more secure to keep it. You can't really save money in a bank that you underwrite, and if you don't underwrite it you're relying on whoever does.

For instance in the UK many local councils did have a surplus before the current crisis, which they invested with Icelandic banks. When those banks crashed that British taxpayer money was lost, and (unsurprisingly) Icelandic voters decided not to pay additional taxes to repay most of it.

Another reason that governments shouldn't save is that they can't get great rates of interest - that comes from taking high risks and someone looking after tax payers' money just can't do that. They have to go for low risk, low payout investments, like gilt bonds.

5. Governments can borrow more easily than anyone else

Note that I'm not saying that it's always simple - governments can fail to the point where they can't borrow any more, but that's rare compared to that happening to people or companies.

Maybe not if it has come from Greece, but as a general rule government debt is still one of the safest investments. Much as the news goes on about governments going bust, most of countries can borrow money for a lot lest interest than most people pay on their mortgages.

Right now the UK government can borrow (i.e. issue bonds) at 0.5% that will be paid back in 10-15 years, well into the next boom. What's the best mortgage or loan you can get?

Putting it all together

For governments to benefit from long term stability they need a plan that always works. They shouldn't be savagely cutting back or raising taxes in the recession and obnoxiously binging or reducing taxes in the boom. If tax and spend is linked to GDP (as assumed above) then alternating cutting and binging could make it all worse.

You want a tax and spend strategy that uses the boom times constructively and weathers the bust times as well as it can. If that's the case then the tax paid and amount spent should stay fairly constant. If you're left wing then that's high tax and high spend all the time, if you're right then that's low tax and low spend all the time. Either way, it should be fairly constant.

If the tax and spend system is constant then there will be either a boom surplus or a recession deficit. You either have to plan for surplus during the boom, or plan for deficit during the bust.

I don't believe that governments can help themselves during a boom. They will always blow that surplus on something stupid, like Millennium Domes, or weapons programs, or wars, or massive tax cuts, or something even dumber. They have an election to win every 4 years and the financial cycle is 10-15.

Even if they save the cash, there's not really anywhere safe to put it.

So it is my conclusion that they should break even during the boom and pay off the debts that they built up during the bust. During a recession they shouldn't panic and change all the plans, instead they should run into debt while the economy recovers and pay it off when the boom comes.

0

Add a comment

Label Cloud
Blog Archive
About Me
About Me
Blogroll
Blogroll
Loading