develooper Front page | perl.perl5.porters | Postings from August 2021

Re: Pre-RFC decimal data type

Thread Previous | Thread Next
Nicholas Clark
August 5, 2021 08:29
Re: Pre-RFC decimal data type
Message ID:
On Thu, Aug 05, 2021 at 08:17:22AM +0000, Ovid via perl5-porters wrote:
> Since we're talking about wishes, would a decimal type be interesting? For example, in floating point, you can't represent .3. So the following evaluates to false:
> if ( 0 == .1 + .2 - .3 ) { ... }

Yes, it would be interesting, but I have no good idea how to implement this
in a performant and portable way.

> Fun fact: many COBOL-to-Java death marches have fallen down and not gotten back up because Java can't match COBOL's precision due to lacking COBOL's native decimal type (and simulating a Decimal type via classes meant that Java couldn't get the performance needed).

This I didn't know. Interesting. Thanks.

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About