aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/odp_std.c
blob: 9db5a35b316734f2c0482b6862c80b3149f5d3f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Copyright (c) 2021, Nokia
 * All rights reserved.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 */

#include <odp/api/std.h>

double odp_fract_u64_to_dbl(const odp_fract_u64_t *fract)
{
	double fraction;

	if (fract->numer == 0)
		fraction = 0.0;
	else
		fraction = (double)fract->numer / fract->denom;

	return fract->integer + fraction;
}