## lustrec / include / mpfr_lustre.c @ 93119c3f

History | View | Annotate | Download (1.82 KB)

1 | 66e25f0f | xthirioux | #include <mpfr.h> |
---|---|---|---|

2 | #include "mpfr_lustre.h" |
||

3 | |||

4 | ```
void MPFR_LUSTRE_INIT () {
``` |
||

5 | ```
return;
``` |
||

6 | } |
||

7 | |||

8 | ```
void MPFR_LUSTRE_CLEAR () {
``` |
||

9 | ```
return;
``` |
||

10 | } |
||

11 | |||

12 | ```
void MPFRNeq_step (mpfr_t i1, mpfr_t i2,
``` |
||

13 | _Bool (*out) |
||

14 | ) |
||

15 | { |
||

16 | *out = mpfr_lessgreater_p(i1, i2); |
||

17 | } |
||

18 | |||

19 | ```
void MPFREq_step (mpfr_t i1, mpfr_t i2,
``` |
||

20 | _Bool (*out) |
||

21 | ) |
||

22 | { |
||

23 | *out = mpfr_equal_p(i1, i2); |
||

24 | } |
||

25 | |||

26 | ```
void MPFRGt_step (mpfr_t i1, mpfr_t i2,
``` |
||

27 | _Bool (*out) |
||

28 | ) |
||

29 | { |
||

30 | *out = mpfr_greater_p(i1, i2); |
||

31 | } |
||

32 | |||

33 | ```
void MPFRGe_step (mpfr_t i1, mpfr_t i2,
``` |
||

34 | _Bool (*out) |
||

35 | ) |
||

36 | { |
||

37 | *out = mpfr_greaterequal_p(i1, i2); |
||

38 | } |
||

39 | |||

40 | extern void MPFRLt_step (mpfr_t i1, mpfr_t i2, |
||

41 | _Bool (*out) |
||

42 | ) |
||

43 | { |
||

44 | *out = mpfr_less_p(i1, i2); |
||

45 | } |
||

46 | ```
void MPFRLe_step (mpfr_t i1, mpfr_t i2,
``` |
||

47 | _Bool (*out) |
||

48 | ) |
||

49 | { |
||

50 | *out = mpfr_lessequal_p(i1, i2); |
||

51 | } |
||

52 | |||

53 | ```
void MPFRDiv_step (mpfr_t i1, mpfr_t i2,
``` |
||

54 | mpfr_t out |
||

55 | ) |
||

56 | { |
||

57 | mpfr_div(out, i1, i2, MPFR_RNDN); |
||

58 | } |
||

59 | |||

60 | ```
void MPFRTimes_step (mpfr_t i1, mpfr_t i2,
``` |
||

61 | mpfr_t out |
||

62 | ) |
||

63 | { |
||

64 | mpfr_mul(out, i1, i2, MPFR_RNDN); |
||

65 | } |
||

66 | |||

67 | ```
void MPFRMinus_step (mpfr_t i1, mpfr_t i2,
``` |
||

68 | mpfr_t out |
||

69 | ) |
||

70 | { |
||

71 | mpfr_sub(out, i1, i2, MPFR_RNDN); |
||

72 | } |
||

73 | |||

74 | ```
void MPFRPlus_step (mpfr_t i1, mpfr_t i2,
``` |
||

75 | mpfr_t out |
||

76 | ) |
||

77 | { |
||

78 | mpfr_add(out, i1, i2, MPFR_RNDN); |
||

79 | } |
||

80 | |||

81 | ```
void MPFRUminus_step (mpfr_t i,
``` |
||

82 | mpfr_t out |
||

83 | ) |
||

84 | { |
||

85 | mpfr_neg(out, i, MPFR_RNDN); |
||

86 | } |
||

87 | |||

88 | ```
void MPFRInit(mpfr_t i, mpfr_prec_t prec)
``` |
||

89 | { |
||

90 | mpfr_init2(i, prec); |
||

91 | } |
||

92 | |||

93 | ```
void MPFRClear(mpfr_t i)
``` |
||

94 | { |
||

95 | mpfr_clear(i); |
||

96 | } |