source: to-imperative/trunk/samples/Arithm/div.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.0 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 div
11{
12
13static const Expr _c_0 = ShortInt::create_expr (-22);
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 ("-2147483648123456789078654321");
34
35RF_FUNC (Main, (), (RF_RES _v_res1))
36  {
37    Expr _v_Div1;
38    RF_CALL (Arithm::Div, (_c_0, _c_1), (_v_Div1));
39    RF_CALL (StdIO::PrintLN, (_v_Div1), ());
40    Expr _v_Div2;
41    RF_CALL (Arithm::Div, (_c_2, _c_2), (_v_Div2));
42    RF_CALL (StdIO::PrintLN, (_v_Div2), ());
43    Expr _v_Div3;
44    RF_CALL (Arithm::Div, (_c_3, _c_2), (_v_Div3));
45    RF_CALL (StdIO::PrintLN, (_v_Div3), ());
46    Expr _v_Div4;
47    RF_CALL (Arithm::Div, (_c_2, _c_3), (_v_Div4));
48    RF_CALL (StdIO::PrintLN, (_v_Div4), ());
49    Expr _v_Div5;
50    RF_CALL (Arithm::Div, (_c_3, _c_3), (_v_Div5));
51    RF_CALL (StdIO::PrintLN, (_v_Div5), ());
52    Expr _v_Div6;
53    RF_CALL (Arithm::Div, (_c_4, _c_5), (_v_Div6));
54    RF_CALL (StdIO::PrintLN, (_v_Div6), ());
55    Expr _v_Div7;
56    RF_CALL (Arithm::Div, (_c_4, _c_6), (_v_Div7));
57    RF_CALL (StdIO::PrintLN, (_v_Div7), ());
58    Expr _v_Div8;
59    RF_CALL (Arithm::Div, (_c_7, _c_8), (_v_Div8));
60    RF_CALL (StdIO::PrintLN, (_v_Div8), ());
61    Expr _v_Div9;
62    RF_CALL (Arithm::Div, (_c_9, _c_4), (_v_Div9));
63    RF_CALL (StdIO::PrintLN, (_v_Div9), ());
64    Expr _v_Div10;
65    RF_CALL (Arithm::Div, (_c_10, _c_8), (_v_Div10));
66    RF_CALL (StdIO::PrintLN, (_v_Div10), ());
67    _v_res1 = empty;
68  }
69RF_END
70
71}
72
73rfrt::Entry rf_entry (div::Main);
74
75}
Note: See TracBrowser for help on using the repository browser.