Changeset 1052


Ignore:
Timestamp:
Jul 24, 2003, 11:33:52 AM (17 years ago)
Author:
luba
Message:
  • test for Rem function is corrected
Location:
to-imperative/trunk/samples/Arithm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/samples/Arithm/rem.cc

    r1051 r1052  
    1515static const Expr _c_1 = ShortInt::create_expr (-11);
    1616
    17 static const Expr _c_2 = ShortInt::create_expr (-2147483647);
     17static const Expr _c_2 = Integer::create_expr ("-11111111111");
    1818
    19 static const Expr _c_3 = ShortInt::create_expr (2147483647);
     19static const Expr _c_3 = Integer::create_expr ("-2147483649");
    2020
    21 static const Expr _c_4 = Integer::create_expr ("2147483648");
     21static const Expr _c_4 = ShortInt::create_expr (-2147483647);
    2222
    23 static const Expr _c_5 = ShortInt::create_expr (2);
     23static const Expr _c_5 = Integer::create_expr ("2147483649");
    2424
    25 static const Expr _c_6 = ShortInt::create_expr (2222222);
     25static const Expr _c_6 = ShortInt::create_expr (2147483647);
    2626
    27 static const Expr _c_7 = ShortInt::create_expr (22345);
     27static const Expr _c_7 = Integer::create_expr ("2147483648");
    2828
    29 static const Expr _c_8 = Integer::create_expr ("-2147483648");
     29static const Expr _c_8 = ShortInt::create_expr (2);
    3030
    31 static const Expr _c_9 = Integer::create_expr ("-2147483649");
     31static const Expr _c_9 = ShortInt::create_expr (2222222);
    3232
    33 static const Expr _c_10 = Integer::create_expr ("-21474836481234567890786543");
     33static const Expr _c_10 = ShortInt::create_expr (22345);
    3434
    35 static const Expr _c_11 = ShortInt::create_expr (-2);
     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);
    3640
    3741RF_FUNC (Main, (), (RF_RES _v_res1))
     
    4145    RF_CALL (StdIO::PrintLN, (_v_Rem1), ());
    4246    Expr _v_Rem2;
    43     RF_CALL (Arithm::Rem, (_c_2, _c_2), (_v_Rem2));
     47    RF_CALL (Arithm::Rem, (_c_0, _c_2), (_v_Rem2));
    4448    RF_CALL (StdIO::PrintLN, (_v_Rem2), ());
    4549    Expr _v_Rem3;
    46     RF_CALL (Arithm::Rem, (_c_3, _c_2), (_v_Rem3));
     50    RF_CALL (Arithm::Rem, (_c_3, _c_4), (_v_Rem3));
    4751    RF_CALL (StdIO::PrintLN, (_v_Rem3), ());
    4852    Expr _v_Rem4;
    49     RF_CALL (Arithm::Rem, (_c_2, _c_3), (_v_Rem4));
     53    RF_CALL (Arithm::Rem, (_c_5, _c_4), (_v_Rem4));
    5054    RF_CALL (StdIO::PrintLN, (_v_Rem4), ());
    5155    Expr _v_Rem5;
    52     RF_CALL (Arithm::Rem, (_c_3, _c_3), (_v_Rem5));
     56    RF_CALL (Arithm::Rem, (_c_3, _c_6), (_v_Rem5));
    5357    RF_CALL (StdIO::PrintLN, (_v_Rem5), ());
    5458    Expr _v_Rem6;
    55     RF_CALL (Arithm::Rem, (_c_4, _c_5), (_v_Rem6));
     59    RF_CALL (Arithm::Rem, (_c_5, _c_6), (_v_Rem6));
    5660    RF_CALL (StdIO::PrintLN, (_v_Rem6), ());
    5761    Expr _v_Rem7;
    58     RF_CALL (Arithm::Rem, (_c_4, _c_6), (_v_Rem7));
     62    RF_CALL (Arithm::Rem, (_c_7, _c_8), (_v_Rem7));
    5963    RF_CALL (StdIO::PrintLN, (_v_Rem7), ());
    6064    Expr _v_Rem8;
    61     RF_CALL (Arithm::Rem, (_c_7, _c_8), (_v_Rem8));
     65    RF_CALL (Arithm::Rem, (_c_7, _c_9), (_v_Rem8));
    6266    RF_CALL (StdIO::PrintLN, (_v_Rem8), ());
    6367    Expr _v_Rem9;
    64     RF_CALL (Arithm::Rem, (_c_9, _c_4), (_v_Rem9));
     68    RF_CALL (Arithm::Rem, (_c_10, _c_11), (_v_Rem9));
    6569    RF_CALL (StdIO::PrintLN, (_v_Rem9), ());
    6670    Expr _v_Rem10;
    67     RF_CALL (Arithm::Rem, (_c_10, _c_11), (_v_Rem10));
     71    RF_CALL (Arithm::Rem, (_c_3, _c_7), (_v_Rem10));
    6872    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), ());
    6976    _v_res1 = empty;
    7077  }
  • to-imperative/trunk/samples/Arithm/rem.out

    r1050 r1052  
    11-1
    2 0
    3 0
    4 0
    5 0
     2-23
     3-2
     42
     5-2
     62
    670
    78817196
  • to-imperative/trunk/samples/Arithm/rem.rf

    r1050 r1052  
    44  { 
    55    <PrintLN <Rem -23 -11>>,
    6     <PrintLN <Rem -2147483647 -2147483647>>,
    7     <PrintLN <Rem 2147483647 -2147483647>>,
    8     <PrintLN <Rem -2147483647 2147483647>>,
    9     <PrintLN <Rem 2147483647 2147483647>>,
     6    <PrintLN <Rem -23 -11111111111>>,
     7    <PrintLN <Rem -2147483649 -2147483647>>,
     8    <PrintLN <Rem 2147483649 -2147483647>>,
     9    <PrintLN <Rem -2147483649 2147483647>>,
     10    <PrintLN <Rem 2147483649 2147483647>>,
    1011
    1112    <PrintLN <Rem 2147483648 2>>,
Note: See TracChangeset for help on using the changeset viewer.