KCalc's Future
Christian Ehrlicher
Ch.Ehrlicher at gmx.de
Sat Dec 8 23:45:51 CET 2007
Andreas Pakulat schrieb:
> On 08.12.07 23:12:16, Christian Ehrlicher wrote:
>> _knumfloat::_knumfloat(QString const & num)
>> {
>> mpf_init(_mpf);
>> mpf_set_str(_mpf, num.toAscii(), 10);
>> }
>>
>> I already tried to pass "10,0" without success. Don't know if "nan" and
>> "inf" is correctly interpreted.
>
> Does gmp create a deep copy of the char*? If not that might be the
> reason, toAscii() returns a QByteArray and that will be implicitly
> converted to char*. However that returns the QByteArray internal buffer
> and thus its gone after the call to mpf_set_str. So either gmp needs to
> do a deep copy in set_str or you need to keep the QByteArray around
> until its not needed anymore.
>
I hope you're wrong - I would consider this as a design bug in gmp
otherwise :)
Christian
More information about the release-team
mailing list