News for hackers. Stuff that matters.
Re:Copilot regurgitating Quake code, including sweary comments by ainar-g on Friday July 02, 2021 @09:40AM (#27711372)
> Or if your language has something specific built in, use that.

Unless your language is PostgreSQL's dialect of SQL, apparently. https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use...

Re:Copilot regurgitating Quake code, including sweary comments by pilif on Friday July 02, 2021 @10:16AM (#27711798)
It has the same issue that the other suggestion of your parent comment had: it can’t deal with fractions of cents, which is an issue you will most likely run into before you will into floating point rounding issues.
Re:Copilot regurgitating Quake code, including sweary comments by fredros on Friday July 02, 2021 @10:21AM (#27711873)
Of course for databases you should use a decimal.