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

Last change on this file since 1051 was 1051, checked in by luba, 18 years ago
  • .cc files for tests (Int is replaced by Integer)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 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 = ShortInt::create_expr (-2147483647);
18
19static const Expr _c_3 = ShortInt::create_expr (2147483647);
20
21static const Expr _c_4 = Integer::create_expr ("2147483648");
22
23static const Expr _c_5 = ShortInt::create_expr (2);
24
25static const Expr _c_6 = ShortInt::create_expr (2222222);
26
27static const Expr _c_7 = ShortInt::create_expr (22345);
28
29static const Expr _c_8 = Integer::create_expr ("-2147483648");
30
31static const Expr _c_9 = Integer::create_expr ("-2147483649");
32
33static const Expr _c_10 = Integer::create_expr ("-21474836481234567890786543");
34
35static const Expr _c_11 = ShortInt::create_expr (-2);
36
37RF_FUNC (Main, (), (RF_RES _v_res1))
38  {
39    Expr _v_Rem1;
40    RF_CALL (Arithm::Rem, (_c_0, _c_1), (_v_Rem1));
41    RF_CALL (StdIO::PrintLN, (_v_Rem1), ());
42    Expr _v_Rem2;
43    RF_CALL (Arithm::Rem, (_c_2, _c_2), (_v_Rem2));
44    RF_CALL (StdIO::PrintLN, (_v_Rem2), ());
45    Expr _v_Rem3;
46    RF_CALL (Arithm::Rem, (_c_3, _c_2), (_v_Rem3));
47    RF_CALL (StdIO::PrintLN, (_v_Rem3), ());
48    Expr _v_Rem4;
49    RF_CALL (Arithm::Rem, (_c_2, _c_3), (_v_Rem4));
50    RF_CALL (StdIO::PrintLN, (_v_Rem4), ());
51    Expr _v_Rem5;
52    RF_CALL (Arithm::Rem, (_c_3, _c_3), (_v_Rem5));
53    RF_CALL (StdIO::PrintLN, (_v_Rem5), ());
54    Expr _v_Rem6;
55    RF_CALL (Arithm::Rem, (_c_4, _c_5), (_v_Rem6));
56    RF_CALL (StdIO::PrintLN, (_v_Rem6), ());
57    Expr _v_Rem7;
58    RF_CALL (Arithm::Rem, (_c_4, _c_6), (_v_Rem7));
59    RF_CALL (StdIO::PrintLN, (_v_Rem7), ());
60    Expr _v_Rem8;
61    RF_CALL (Arithm::Rem, (_c_7, _c_8), (_v_Rem8));
62    RF_CALL (StdIO::PrintLN, (_v_Rem8), ());
63    Expr _v_Rem9;
64    RF_CALL (Arithm::Rem, (_c_9, _c_4), (_v_Rem9));
65    RF_CALL (StdIO::PrintLN, (_v_Rem9), ());
66    Expr _v_Rem10;
67    RF_CALL (Arithm::Rem, (_c_10, _c_11), (_v_Rem10));
68    RF_CALL (StdIO::PrintLN, (_v_Rem10), ());
69    _v_res1 = empty;
70  }
71RF_END
72
73}
74
75rfrt::Entry rf_entry (rem::Main);
76
77}
Note: See TracBrowser for help on using the repository browser.