about summary refs log tree commit diff
path: root/converter/other/fiasco/lib/rpf.h
blob: 19e330fb2e19b910af2fc57262cd33fd01902e7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 *  rpf.h
 *
 *  Written by:         Stefan Frank
 *                      Richard Krampfl
 *                      Ullrich Hafner
 *
 *  This file is part of FIASCO (Fractal Image And Sequence COdec)
 *  Copyright (C) 1994-2000 Ullrich Hafner
 */

/*
 *  $Date: 2000/06/14 20:49:37 $
 *  $Author: hafner $
 *  $Revision: 5.1 $
 *  $State: Exp $
 */

#ifndef _RPF_H
#define _RPF_H

#include "types.h"
#include "fiasco.h"

typedef struct rpf
{
   unsigned           mantissa_bits;    /* number of bits used for mantissa */
   real_t             range;            /* scale value to [-range, +range] */
   fiasco_rpf_range_e range_e;
} rpf_t;

int
rtob (real_t real, const rpf_t *rpf);
real_t
btor (int b, const rpf_t *rpf);
rpf_t *
alloc_rpf (unsigned mantissa, fiasco_rpf_range_e range);

extern const int RPF_ZERO;

#endif /* not _RPF_H */