Changeset 200fcb3 for tests/math4.cfa
- Timestamp:
- Dec 12, 2018, 9:16:12 AM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 5ebb1368
- Parents:
- 3d99498
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/math4.cfa
r3d99498 r200fcb3 10 10 // Created On : Thu May 24 20:56:54 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 6 17:59:14201813 // Update Count : 312 // Last Modified On : Tue Dec 4 18:15:01 2018 13 // Update Count : 4 14 14 // 15 15 … … 24 24 //---------------------- Nearest Integer ---------------------- 25 25 26 sout | "floor:" | floor( 1.2F ) | floor( 1.2D ) | floor( 1.2L ) | endl;27 sout | "ceil:" | ceil( 1.6F ) | ceil( 1.6D ) | ceil( 1.6L ) | endl;28 sout | "trunc:" | trunc( 3.5F ) | trunc( 3.5D ) | trunc( 3.5L ) | endl;29 sout | "rint:" | (float)rint( 1.5F ) | (double)rint( 1.5D ) | (long double)rint( 1.5L ) | endl;30 sout | "rint:" | (long int)rint( 1.5F ) | (long int)rint( 1.5D ) | (long int)rint( 1.5L ) | endl;31 sout | "rint:" | (long long int)rint( 1.5F ) | (long long int)rint( 1.5D ) | (long long int)rint( 1.5L ) | endl;32 sout | "lrint:" | lrint( 1.5F ) | lrint( 1.5D ) | lrint( 1.5L ) | endl;33 sout | "llrint:" | llrint( 1.5F ) | llrint( 1.5D ) | llrint( 1.5L ) | endl;34 sout | "nearbyint:" | nearbyint( 3.5F ) | nearbyint( 3.5D ) | nearbyint( 3.5L ) | endl;35 sout | "round:" | (float)round( 1.5F ) | (double)round( 1.5D ) | (long double)round( 1.5L ) | endl;36 sout | "round:" | (long int)round( 1.5F ) | (long int)round( 1.5D ) | (long int)round( 1.5L ) | endl;37 sout | "round:" | (long long int)round( 1.5F ) | (long long int)round( 1.5D ) | (long long int)round( 1.5L ) | endl;38 sout | "lround:" | lround( 1.5F ) | lround( 1.5D ) | lround( 1.5L ) | endl;39 sout | "llround:" | llround( 1.5F ) | llround( 1.5D ) | llround( 1.5L ) | endl;26 sout | "floor:" | floor( 1.2F ) | floor( 1.2D ) | floor( 1.2L ); 27 sout | "ceil:" | ceil( 1.6F ) | ceil( 1.6D ) | ceil( 1.6L ); 28 sout | "trunc:" | trunc( 3.5F ) | trunc( 3.5D ) | trunc( 3.5L ); 29 sout | "rint:" | (float)rint( 1.5F ) | (double)rint( 1.5D ) | (long double)rint( 1.5L ); 30 sout | "rint:" | (long int)rint( 1.5F ) | (long int)rint( 1.5D ) | (long int)rint( 1.5L ); 31 sout | "rint:" | (long long int)rint( 1.5F ) | (long long int)rint( 1.5D ) | (long long int)rint( 1.5L ); 32 sout | "lrint:" | lrint( 1.5F ) | lrint( 1.5D ) | lrint( 1.5L ); 33 sout | "llrint:" | llrint( 1.5F ) | llrint( 1.5D ) | llrint( 1.5L ); 34 sout | "nearbyint:" | nearbyint( 3.5F ) | nearbyint( 3.5D ) | nearbyint( 3.5L ); 35 sout | "round:" | (float)round( 1.5F ) | (double)round( 1.5D ) | (long double)round( 1.5L ); 36 sout | "round:" | (long int)round( 1.5F ) | (long int)round( 1.5D ) | (long int)round( 1.5L ); 37 sout | "round:" | (long long int)round( 1.5F ) | (long long int)round( 1.5D ) | (long long int)round( 1.5L ); 38 sout | "lround:" | lround( 1.5F ) | lround( 1.5D ) | lround( 1.5L ); 39 sout | "llround:" | llround( 1.5F ) | llround( 1.5D ) | llround( 1.5L ); 40 40 41 41 //---------------------- Manipulation ---------------------- 42 42 43 sout | "copysign:" | copysign( 1.0F, -1.0F ) | copysign( 1.0D, -1.0D ) | copysign( 1.0L, -1.0L ) | endl;43 sout | "copysign:" | copysign( 1.0F, -1.0F ) | copysign( 1.0D, -1.0D ) | copysign( 1.0L, -1.0L ); 44 44 int exp; 45 45 f = frexp( 4.0F, &exp ); 46 sout | "frexp:" | f | exp ;46 sout | "frexp:" | f | exp | nonl; 47 47 d = frexp( 4.0D, &exp ); 48 sout | d | exp ;48 sout | d | exp | nonl; 49 49 l = frexp( 4.0L, &exp ); 50 sout | l | exp | endl;51 sout | "ldexp:" | ldexp( 2.0F, 2 ) | ldexp( 2.0D, 2 ) | ldexp( 2.0L, 2 ) | endl;50 sout | l | exp; 51 sout | "ldexp:" | ldexp( 2.0F, 2 ) | ldexp( 2.0D, 2 ) | ldexp( 2.0L, 2 ); 52 52 float fi; 53 53 double di; 54 54 long double ldi; 55 55 f = modf( 2.3F, &fi ); 56 sout | "modf:" | fi | f ;56 sout | "modf:" | fi | f | nonl; 57 57 d = modf( 2.3D, &di ); 58 sout | di | d ;58 sout | di | d | nonl; 59 59 l = modf( 2.3L, &ldi ); 60 sout | ldi | l | endl;61 sout | "modf:" | modf( 2.3F ) | modf( 2.3D ) | modf( 2.3L ) | endl;62 sout | "nextafter:" | nextafter( 2.0F, 3.0F ) | nextafter( 2.0D, 3.0D ) | nextafter( 2.0L, 3.0L ) | endl;63 sout | "nexttoward:" | nexttoward( 2.0F, 3.0F ) | nexttoward( 2.0D, 3.0D ) | nexttoward( 2.0L, 3.0L ) | endl;60 sout | ldi | l; 61 sout | "modf:" | modf( 2.3F ) | modf( 2.3D ) | modf( 2.3L ); 62 sout | "nextafter:" | nextafter( 2.0F, 3.0F ) | nextafter( 2.0D, 3.0D ) | nextafter( 2.0L, 3.0L ); 63 sout | "nexttoward:" | nexttoward( 2.0F, 3.0F ) | nexttoward( 2.0D, 3.0D ) | nexttoward( 2.0L, 3.0L ); 64 64 65 sout | "scalbn:" | scalbn( 2.0F, 3 ) | scalbn( 2.0D, 3 ) | scalbn( 2.0L, 3 ) | endl;66 sout | "scalbln:" | scalbln( 2.0F, 3L ) | scalbln( 2.0D, 3L ) | scalbln( 2.0L, 3L ) | endl;65 sout | "scalbn:" | scalbn( 2.0F, 3 ) | scalbn( 2.0D, 3 ) | scalbn( 2.0L, 3 ); 66 sout | "scalbln:" | scalbln( 2.0F, 3L ) | scalbln( 2.0D, 3L ) | scalbln( 2.0L, 3L ); 67 67 } // main 68 68
Note: See TracChangeset
for help on using the changeset viewer.