From fa9b6f2b9bcb80778e63ef2aa4e17c7573de0015 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Tue, 24 May 2016 13:39:23 +0000 Subject: Initial commit --- src/double_util.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/double_util.c (limited to 'src/double_util.c') diff --git a/src/double_util.c b/src/double_util.c new file mode 100644 index 0000000..a4b5949 --- /dev/null +++ b/src/double_util.c @@ -0,0 +1,30 @@ +/* +Copyright 2016 Ian Jauslin + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "double_util.h" +#include + +// convert hh_params +int hh_params_todouble(hh_params_double* params_double, hh_params params){ + params_double->omega=params.omega; + params_double->t1=mpfr_get_ld(params.t1, MPFR_RNDN); + params_double->t2=mpfr_get_ld(params.t2, MPFR_RNDN); + params_double->lambda=mpfr_get_ld(params.lambda, MPFR_RNDN); + params_double->sinphi=mpfr_get_ld(params.sinphi, MPFR_RNDN); + params_double->phi=mpfr_get_ld(params.phi, MPFR_RNDN); + params_double->W=mpfr_get_ld(params.W, MPFR_RNDN); + return(0); +} -- cgit v1.2.3-70-g09d2