Changeset c274df2


Ignore:
Timestamp:
Mar 26, 2019, 5:59:05 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7726839
Parents:
980aa4a
Message:

update and add exponential tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/math1.cfa

    r980aa4a rc274df2  
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 12 16:28:49 2018
    13 // Update Count     : 89
     12// Last Modified On : Mon Mar 25 22:56:47 2019
     13// Update Count     : 109
    1414//
    1515
     
    4949        unsigned int e = 2;
    5050    b \= e;
    51     sout | "\\" | b | b \ e;
    52     sout | "\\" | 'a' \ 3u | 2 \ 8u | 4 \ 3u | -4 \ 3u | nonl;
     51    sout | b | "\\" | e | "= " | b \ e;
     52    sout | 'a' \ 3 | 2 \ 8 | 4 \ 3 | -4 \ 3 | 4 \ -3 | -4 \ -3;
     53        sout | 4.0 \ -3 | -4.0 \ -3 | 4.0 \ 2.1 | (1.0f+2.0fi) \ (3.0f+2.0fi);
    5354        sout | 4 \ -3 | -4 \ -3 | 4.0 \ 2.1 | (1.0f+2.0fi) \ (3.0f+2.0fi);
     55
     56        struct S { int i; };
     57        double ?*?( double d, S s ) { return d * s.i; }
     58        double ?/?( double d, S s ) { return d / s.i; }
     59        S ?\?( S s, unsigned long y ) { return (S){ s.i \ y }; }
     60        ofstream & ?|?( ofstream & os, S s ) { return os | s.i; }
     61        void ?|?( ofstream & os, S s ) { (ofstream &)(os | s); nl( os ); }
     62        S s = { 4 };
     63        S x = s \ 2;
     64        sout | x;
     65        sout | s.i | s \ 2u;
    5466} // main
    5567
Note: See TracChangeset for help on using the changeset viewer.