#hi
32 messages · Page 1 of 1 (latest)
you cant use sin or cos directly with gmpxx
it works with integers and rationals not floats
if you really need trig just convert the mpf_class to double like this:
double d = x.get_d();
double result = sin(d);
or go with mpfr if you want actual high precision trig functions
mpfr alone can provide high accuracy ?
accuracy will be gone
though i also need large int
yeah mpfr gives high precision for floats for big ints use gmp alongside it
@sly sage has reached level 1. GG!
mpfr is actually built on gmp so they work well together
you won't lose accuracy if you stick to mpfr for all float stuff
double will make the varible lose some digits
@sudden musk has reached level 3. GG!
yeah u right exactly double has like 15–17 digits precision max
if you need way more use mpfr_class instead of converting to double
mpfr_class x("number", number);
mpfr_class y = sin(x);
something like that
can i convert gmpxx varible ot mpfr varible and return it ?
yea
i need tan (mpq_class *mpf_class )
and return tan to gmpxx , its sad how they dont work togther
yeah fr it sucks they don’t work together
but you can return the tan result back to the class
is it hard to rewrite a similar library ?