• 1 Post
  • 33 Comments
Joined 3 months ago
cake
Cake day: July 10th, 2025

help-circle




  • No you spouted some stuff about “trust me I’ve seen it” (almost certainly relating to using single floats) then an irrelevant tangent about how ten doesnt divde cleanly into three and how thats a problem for floats, when you have exactly the same problem with fixed point/integer division.

    Do you have an actual example of where double precission floats would cause an issue? Preferably an example that could be run to demonstrate it.



  • I fail to see a difference there, 10.0/3 = 3.33333333333 which you round down to 3.33 (or whatever fraction of a cent you are using) as you say for all accounts then have to deal with the leftovers, if you are using a fixed decimal as the article sugests you get the same issue, if you are using integer fractions of a cent, say milicents you get 1000000/3 = 333333 which gives you the exact same rounding error.

    This isnt a problem with the representation of numbers its trying to split a quantity into unequal parts using division. (And it should be noted the double is giving the most accurate representation of 10/3 dollars here, and so would be most accurate if this operation was in the middle of a series of calcuations rather than about to be immediately moving money).

    As I said before, doubles probably arent the best way to handle money if you are dealing with high volumes of or complex transactions, but they are not the waiting disaster that single floats are and using a double representation then converting to whole cents when you need to actually move real money (like a sale) is fine.


  • You are underestimating how precice doubles are. Summing up one million doubles randomly selected from 0 to one trillion only gives a cumulative rounding error of ~60, that coud be one million transactions with 0-one billion dollars with 0.1 cent resolution and ending up off by a total of 6 cents. Actually it would be better than that as you could scale it to something like thousands or millions of dollars to keep you number ranger closer to 1.

    Sure if you are doing very high volumes you probably dont want to do it, but for a lot of simple cases doubles are completely fine.

    Edit: yeah using the same million random numbers but dividing them all by 1000 before summing (so working in kilodollars rather than dollars) gave perfect accuracy, no rounding errors at all after one million 1e-3 to 1e9 double additions.


  • Single floats sure, but doubles give plenty of accuracy unless you absolutely need zero error.

    For example geting 1000 random 12 digit ints, multiplying them by 1e9 as floats, doing pairwise differences between them and summing the answers and dividing by 1e9 to get back to the ints gives a cumulative error of 1 in 10^16. assuming your original value was in dollars thats roughly 0.001cent in a billion dollar total error. That’s going deliberately out of the way to make transactions as perverse as possible.


  • You recharge your storage device (a metal tank) by pouring in more liquid over 30 seconds. That ease of use combined with how energy dense oil derivatives are is such a massive benefit for them.

    The problem with fossil fuels is that they are slowly choking our planet, except for that they are phenomenal energy sources on who’s backs the modern world was built. That is why it is so hard for us to transition away from them.




  • Racsism is likely part of it, but the real value is in having a solid ally that can be used as a base to project power across the largest oil producing region in the world.

    How long Israel remains seen as a solid ally given their recent unhinged and mask off behaviour remains to be seen. To me it does feel like there is a sea change in opinion on them, both from everyday people and from politicos.



  • Even calling it tax evasion is a stretch, she had a complicated situation involving a trust set up for the house she had with her ex to insure her severely disabled son would be taken care of, then she claimed her new flat was her primary residence leading to a lower rate of stamp duty. She got some advice that said it was ok but was then told she should seek specialist legal advice to check that which she didnt and now has to pay back 40k.

    Its not good, and she was right to step down, especially as housing minister, but its hardly a grievous sin.







  • FWIW the article does make sense, though the conclusion I’d draw wouldnt be the same as theirs but:

    Jane is earning £60k and claiming child benefit for three children. That’s worth £3,094.

    She’s now in the 42% tax band.6 Jane still pays basic rate tax for her income between £12,570 and £50,270, but now pays 42% tax for everything over that. So her total tax bill is (50270 – 12570) * 28% + (60000-50270) * 42% = £14,643 and Jane takes home £45,357.

    Jane is thinking of working a few more hours to earn another £1,000. She’s in the higher tax band – so in a sane world she’d expect another £420 of tax, and a marginal rate of 42%.

    But that is not the result. Once Jane’s income hits £60,200, the “High Income Child Benefit Charge” (introduced by George Osborne) starts to apply to claw back her child benefit – 1% for every £200 of earnings.

    The marginal rate – the tax Jane is paying on that new £1,000. This is 56.5% – and we will have the same result for all incomes between £60k and £80k.

    The solution I’d draw from that would be to raise the higher rate from 42 to 45-50% and scrap the means testing of child benefits. Makes the tax take more progressive and reduces administrative burden by not having to assess people’s income for if they are eligible for child support or not.