Re: [RFC] Floating Point support in GMP extension

From: Date: Sun, 05 Jan 2014 18:09:04 +0000
Subject: Re: [RFC] Floating Point support in GMP extension
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-71010@lists.php.net to get a copy of this message
Sara Golemon wrote:
* Is there any way to get rid of the locale-dependent behavior of mpf_set_str? This sounds like it could be a big pain. (Especially given how gmp floats are not what you use with your average user input, so seems little useful.)
Not really... libgmp can't be told "don't do that", and unilaterally calling setlocale() is probably a bad idea (as it's not thread local). We could query localeconv() and str_replace the input to normalize '.' -> locale->decimal_point, but that's a bit hacky IMO. Or temporarily change LC_DECIMAL (when not in ZTS mode). Still hacky...
The question is more one of "is this is the correct process anyway?" I'm still looking into an alternate problem with allowing client locale action in these cases. One of the sites I've been playing with has a problem with clients who insist on using the wrong separators and this is not a server local problem, but a client one :( -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

« previous php.internals (#71010) next »