I keep seeing this number used instead of actual dollar numbers. Isn't most government spending a part of GDP? If $1 billion spent on a battleship raises the GDP by $1 billion, doesn't that fatally skew the percentage formula?
Let me start by reminding you that GDP is a measure of the total amount of goods and services produced in an economy, say the USA, in a year. So it sums the total value in dollars of everything that has been produced in the country in a given year.
So the GDP, as this measure of production, will include the value of the battleship produced this year, no matter who bought it, let’s say the government or someone in the “private sector” (even though not many private individuals would go around buying battleships).
Essentially what you are referring to is to an usual way economists try to analyze the components of GDP. In this “expenditure approach” we are asking ourselves, who spent money to buy any good and service, for example, the battleship. That leads to the usual decomposition of this GDP into its components of Private Consumption, Government Purchases, Investment by firms and Net Exports.
When the government spends money of the battleship there is no change in the GDP, the battleship has been produced already, now we are just doing an accounting exercise to figure out which sector bought it.
More importantly in your question, it would also not matter for the GDP how the government paid for it, say using new taxes to fund the expenditure or by borrowing money (which increases the deficit), since that decision does not change the fact that the battleship has been produced already for that year. Hence, if we increase government debt to pay for the battleship, the deficit as a % of the GDP grows, while if the government levies a new tax to pay for the purchase, it does not. Hence the measure of the deficit as a percentage of the GDP is still valid, since the GDP did not move (as it would not have moved if I had bought the battleship for my private navy as a private consumer).
The short answer to your question is that we calculate the deficit as a proportion of ex-post, that is, the realized GDP, so it is a mere accounting calculation.
Now, at this point you are probably thinking: “Sure, that makes sense but this was not really my question.”
I know, because I am sidestepping an important thing that I believe was implicit in your question. That is that the extra government expenditure by the government in procuring the construction of the battleship in the first place will add to the GDP, which would not have been built in the absence of that order. Now, the answer to this depends on a lot of things, like, are you thinking about impacts on the GDP on the long term or short term. But let’s take the Keynesian view and take for granted that in the short run the extra government expenditure will bring the GDP up next year (even though it might not in the long run). If that is the case, then next year after the new battleship is built, GDP will be larger and if the government deficit in dollars does not change, the deficit as a proportion of the (new) GDP will be smaller. As you can see that is baked in into the calculation, since it considers the actual GDP after the fact.