source: to-imperative/trunk/samples/Arithm/rem.cc @ 1052

Last change on this file since 1052 was 1052, checked in by luba, 18 years ago
  • test for Rem function is corrected
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1#include <rf_core.hh>
2#include <refal/StdIO.hh>
3#include <refal/Arithm.hh>
4
5namespace refal
6{
7
8using namespace rfrt;
9
10namespace rem
11{
12
13static const Expr _c_0 = ShortInt::create_expr (-23);
14
15static const Expr _c_1 = ShortInt::create_expr (-11);
16
17static const Expr _c_2 = Integer::create_expr ("-11111111111");
18
19static const Expr _c_3 = Integer::create_expr ("-2147483649");
20
21static const Expr _c_4 = ShortInt::create_expr (-2147483647);
22
23static const Expr _c_5 = Integer::create_expr ("2147483649");
24
25static const Expr _c_6 = ShortInt::create_expr (2147483647);
26
27static const Expr _c_7 = Integer::create_expr ("2147483648");
28
29static const Expr _c_8 = ShortInt::create_expr (2);
30
31static const Expr _c_9 = ShortInt::create_expr (2222222);
32
33static const Expr _c_10 = ShortInt::create_expr (22345);
34
35static const Expr _c_11 = Integer::create_expr ("-2147483648");
36
37static const Expr _c_12 = Integer::create_expr ("-21474836481234567890786543");
38
39static const Expr _c_13 = ShortInt::create_expr (-2);
40
41RF_FUNC (Main, (), (RF_RES _v_res1))
42  {
43    Expr _v_Rem1;
44    RF_CALL (Arithm::Rem, (_c_0, _c_1), (_v_Rem1));
45    RF_CALL (StdIO::PrintLN, (_v_Rem1), ());
46    Expr _v_Rem2;
47    RF_CALL (Arithm::Rem, (_c_0, _c_2), (_v_Rem2));
48    RF_CALL (StdIO::PrintLN, (_v_Rem2), ());
49    Expr _v_Rem3;
50    RF_CALL (Arithm::Rem, (_c_3, _c_4), (_v_Rem3));
51    RF_CALL (StdIO::PrintLN, (_v_Rem3), ());
52    Expr _v_Rem4;
53    RF_CALL (Arithm::Rem, (_c_5, _c_4), (_v_Rem4));
54    RF_CALL (StdIO::PrintLN, (_v_Rem4), ());
55    Expr _v_Rem5;
56    RF_CALL (Arithm::Rem, (_c_3, _c_6), (_v_Rem5));
57    RF_CALL (StdIO::PrintLN, (_v_Rem5), ());
58    Expr _v_Rem6;
59    RF_CALL (Arithm::Rem, (_c_5, _c_6), (_v_Rem6));
60    RF_CALL (StdIO::PrintLN, (_v_Rem6), ());
61    Expr _v_Rem7;
62    RF_CALL (Arithm::Rem, (_c_7, _c_8), (_v_Rem7));
63    RF_CALL (StdIO::PrintLN, (_v_Rem7), ());
64    Expr _v_Rem8;
65    RF_CALL (Arithm::Rem, (_c_7, _c_9), (_v_Rem8));
66    RF_CALL (StdIO::PrintLN, (_v_Rem8), ());
67    Expr _v_Rem9;
68    RF_CALL (Arithm::Rem, (_c_10, _c_11), (_v_Rem9));
69    RF_CALL (StdIO::PrintLN, (_v_Rem9), ());
70    Expr _v_Rem10;
71    RF_CALL (Arithm::Rem, (_c_3, _c_7), (_v_Rem10));
72    RF_CALL (StdIO::PrintLN, (_v_Rem10), ());
73    Expr _v_Rem11;
74    RF_CALL (Arithm::Rem, (_c_12, _c_13), (_v_Rem11));
75    RF_CALL (StdIO::PrintLN, (_v_Rem11), ());
76    _v_res1 = empty;
77  }
78RF_END
79
80}
81
82rfrt::Entry rf_entry (rem::Main);
83
84}
Note: See TracBrowser for help on using the repository browser.