Re: Proposal: native decimal scalar type support

From: Date: Wed, 26 Apr 2023 15:18:43 +0000
Subject: Re: Proposal: native decimal scalar type support
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-120139@lists.php.net to get a copy of this message
You’re going to likely have this with database as well - at least ODBC presents decimals as strings, because they can’t be represented as a C type (without turning it into a struct of some sort). > On Apr 26, 2023, at 9:23 AM, Alexander Pravdin <alex.pravdin@interi.co> wrote: > > On Wed, 26 Apr 2023 at 20:52, Benjamin Morel <benjamin.morel@gmail.com> wrote: > >> For what it’s worth, this is already solved in userland: >> https://github.com/brick/math > > When I checked the sources, the first I saw was: > >> final class BigInteger extends BigNumber >> { >> private string $value; > > It also converts to strings back and forth which can not be as > performant as native calculations and still is (with respect to the > authors) yet another band-aid over the missing core functionality. I > know that there are workarounds, but my proposal is about native > support. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php >

« previous php.internals (#120139) next »