[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MPFRCPP] Re: MPFRCPP
From: |
Alexey Beshenov |
Subject: |
[MPFRCPP] Re: MPFRCPP |
Date: |
Tue, 8 Apr 2008 23:01:10 +0400 |
User-agent: |
KMail/1.9.5 |
1. MPFRCPP does not wrap features which are not present in MPFR.
2. Also, MFPRCPP does not support operations between fixed precision types and
mpfr::Real due to potential loss of precision (so don't expect '+' or '*' to
be overloaded for mpfr::Real---double).
On Tuesday 08 April 2008 22:29, jtl wrote:
> I advanced in using your library.
> There is a little feature lacking : float construction assignement and
> conversion. Was it voluntary
> For me its necessary to have the feature. I do not know if mpfr
> supports floats but the lines below make the
> join for me.
>
>
> Real& operator= (const float& y) throw() {
> mpfr_set_d (getMpfrT(), y,
> getParameters().getDefaultRoundMode().getMpfrRndT());
> return *this;
> }
>
> operator float () const throw (ConversionDoesNotFitsError) {
> if (isFits<float>())
> return mpfr_get_d (getMpfrT(),
> getParameters().getDefaultRoundMode().getMpfrRndT());
> else
> throw ConversionDoesNotFitsError ();
> }
>
> Real (const float& x, const RoundMode& rm) throw() {
> mpfr_init2(getMpfrT(),
> getParameters().getDefaultPrecision().getMpfrPrecT());
> mpfr_set_d (getMpfrT(), x, rm.getMpfrRndT ());
> }
>
> Real (const float& x, const Precision& pr =
> getParameters().getDefaultPrecision(), const RoundMode& rm =
> getParameters().getDefaultRoundMode()) throw() {
> mpfr_init2(getMpfrT(), pr.getMpfrPrecT());
> mpfr_set_d (getMpfrT(), x, rm.getMpfrRndT ());
> }
>
>
> Do you think it could be added ?
>
> thanks
>
> JT Lapresté
--
Alexey Beshenov <address@hidden>
http://beshenov.ru/
pgpHtc9Wr9tQ_.pgp
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [MPFRCPP] Re: MPFRCPP,
Alexey Beshenov <=