source: tests/math2.cfa @ 47e18f3

arm-ehjacob/cs343-translationnew-ast-unique-expr
Last change on this file since 47e18f3 was 47e18f3, checked in by Peter A. Buhr <pabuhr@…>, 9 months ago

restire math1-4 and .except for oast

  • Property mode set to 100644
File size: 2.4 KB
RevLine 
[47e18f3]1//
2// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// math2.cfa --
8//
9// Author           : Peter A. Buhr
10// Created On       : Fri Apr 22 14:59:21 2016
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Wed Dec 12 16:11:35 2018
13// Update Count     : 87
14//
15
16#include <fstream.hfa>
17#include <math.hfa>
18
19int main( void ) {
20        float f;
21        double d;
22        long double l;
23
24        //---------------------- Logarithm ----------------------
25
26        sout | "log:" | log( 1.0F ) | log( 1.0D ) | log( 1.0L ) | nonl;
27        sout | log( 1.0F+1.0FI ) | log( 1.0D+1.0DI ) | log( 1.0DL+1.0LI );
28        sout | "log2:" | log2( 8.0F ) | log2( 8.0D ) | log2( 8.0L );
29        sout | "log10:" | log10( 100.0F ) | log10( 100.0D ) | log10( 100.0L );
30        sout | "log1p:" | log1p( 1.0F ) | log1p( 1.0D ) | log1p( 1.0L );
31        sout | "ilogb:" | ilogb( 1.0F ) | ilogb( 1.0D ) | ilogb( 1.0L );
32        sout | "logb:" | logb( 8.0F ) | logb( 8.0D ) | logb( 8.0L );
33
34        sout | "sqrt:" | sqrt( 1.0F ) | sqrt( 1.0D ) | sqrt( 1.0L ) | nonl;
35        sout | sqrt( 1.0F+1.0FI ) | sqrt( 1.0D+1.0DI ) | sqrt( 1.0DL+1.0LI );
36        sout | "cbrt:" | cbrt( 27.0F ) | cbrt( 27.0D ) | cbrt( 27.0L );
37        sout | "hypot:" | hypot( 1.0F, -1.0F ) | hypot( 1.0D, -1.0D ) | hypot( 1.0L, -1.0L );
38
39        //---------------------- Trigonometric ----------------------
40
41        sout | "sin:" | sin( 1.0F ) | sin( 1.0D ) | sin( 1.0L ) | nonl;
42        sout | sin( 1.0F+1.0FI ) | sin( 1.0D+1.0DI ) | sin( 1.0DL+1.0LI );
43        sout | "cos:" | cos( 1.0F ) | cos( 1.0D ) | cos( 1.0L ) | nonl;
44        sout | cos( 1.0F+1.0FI ) | cos( 1.0D+1.0DI ) | cos( 1.0DL+1.0LI );
45        sout | "tan:" | tan( 1.0F ) | tan( 1.0D ) | tan( 1.0L ) | nonl;
46        sout | tan( 1.0F+1.0FI ) | tan( 1.0D+1.0DI ) | tan( 1.0DL+1.0LI );
47        sout | "asin:" | asin( 1.0F ) | asin( 1.0D ) | asin( 1.0L ) | nonl;
48        sout | asin( 1.0F+1.0FI ) | asin( 1.0D+1.0DI ) | asin( 1.0DL+1.0LI );
49        sout | "acos:" | acos( 1.0F ) | acos( 1.0D ) | acos( 1.0L ) | nonl;
50        sout | acos( 1.0F+1.0FI ) | acos( 1.0D+1.0DI ) | acos( 1.0DL+1.0LI );
51        sout | "atan:" | atan( 1.0F ) | atan( 1.0D ) | atan( 1.0L ) | nonl;
52        sout | atan( 1.0F+1.0FI ) | atan( 1.0D+1.0DI ) | atan( 1.0DL+1.0LI );
53        sout | "atan2:" | atan2( 1.0F, 1.0F ) | atan2( 1.0D, 1.0D ) | atan2( 1.0L, 1.0L ) | nonl;
54        sout | "atan:" | atan( 1.0F, 1.0F ) | atan( 1.0D, 1.0D ) | atan( 1.0L, 1.0L );
55} // main
56
57// Local Variables: //
58// tab-width: 4 //
59// compile-command: "cfa math2.cfa" //
60// End: //
Note: See TracBrowser for help on using the repository browser.