Scroll to the second paragraph, get a subscribe popover. So annoying. I haven't even read any reasonable amount of content yet.
Programming
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
Link a free copy or none at all please
The medium (lol) is annoying, but it didn't ask me to pay. Is the article not free for you?
I think using millicents is pretty standard in fin-tech.
I become suspicious when I see a Medium user posting well-written deep articles as frequently as this user appears to be doing. How can we tell whether this is AI slop or not?
Their articles aren't that deep and they mostly focus on similar topics.
I think it's perfectly possible for someone to have a backlog of work/experience that they are just now writing about.
If it were AI spam, I would expect many disparate topics at a depth slightly more than a typical blog post but clearly not expert. The user page shows the latter, but not the former.
However, the Rubik's cube article does seem abnormal. The phrasing and superficiality makes it seem computer-generated, a real Rubik's afficionado would have spent some time on how they cube.
Of course I say this as someone much more into mathematics than "normal" software engineering. So maybe their writing on those topics is abnormal.
You could just limit the precision of the float. If you are writing banking software or something you could just add a special case to flip flop the remainder or something. I think pretty much all modern languages support this. You should also be using doubles for any numbers that could potentially grow really large like fiat currencies. The issues with floats really is that it will often favor precision over range. You could end up with lots of numbers after a decimal and very little integer range which could cause overruns or something.
The article goes into depth about what you should be using. Floats and doubles are not designed for use with base 10 fractions. They're good at estimating them, but not accurate enough for real financial use.
There's also not much reason to reinvent the wheel for an already solved problem. Many languages have this data type already built into the language, and the rest usually have it available through a package.
Oh nice I'm far from a professional programmer. Thxs for the explanation.
Stop Using Floats
no shit
or Cents
huh..?
That was a good point.
I think maybe they meant using integers for cents
I stopped using floats 30 years ago when I learned what rounding errors can do if you only deal with big enough numbers of items to tally. My employer turned around 25M a year, and it had to add up to the cent for the audits.
And KSP (rocket exploding game) had ten years worth of floating point errors.
Like Minecraft has, too. Just go on a long, long walk in one direction.
What happens?
The physics starts to glitch out, or at least used to, until it got upgraded to doubles. I also use doubles for my game engine, as well as (optionally) limiting pixel-precise things within int.max
and int.min
.
Does the world repeat after a set point?
Technically yes, and with tile layers, you can even set them repeating on a shorter area.
All kinds of weird things. There is a video explaining the details, and you've got to be far, far out.
Used to*, it was fixed in some version or another, where the procgen no longer evaluated how far you were from the origin
The game, including worldgen, will still bug out at longer distances - the issues were reduced and a world limit was added to prevent you going too far, and IIRC past a certain point the world turns into non-stop ocean, but I'm pretty sure if you bypass those limits you'll encounter chunks that outright fail to generate.
OK, I have not played it for AGES. Nice to see something like that fixed, as it was a bit system-inherent.
I'll have to look it up after work. Sounds interesting.
There's a good documentary about this.
Fun fact: This is actually called the Salami Shaving Scam. Basically, shave off tiny pieces of a bunch of large chunks, and eventually you’ll have a massive amount. Like taking a single slice of salami from every sausage that is sold.