Changeset 43385ca
- Timestamp:
- Dec 16, 2016, 10:23:20 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 8f60f0b
- Parents:
- 66f8528
- Location:
- src/libcfa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/libcfa/math.c ¶
r66f8528 r43385ca 1 // 1 // 2 2 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 3 3 // 4 4 // The contents of this file are covered under the licence agreement in the 5 5 // file "LICENCE" distributed with Cforall. 6 // 7 // math.c -- 8 // 6 // 7 // math.c -- 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Tue Apr 19 22:23:08 2016 … … 12 12 // Last Modified On : Sun Apr 24 08:52:31 2016 13 13 // Update Count : 75 14 // 14 // 15 15 16 16 #include "math" … … 34 34 long double remainder( long double x, long double y ) { return remainderl( x, y ); } 35 35 36 //[ int, float ] remquo( float x, float y ) { int quo; x = remquof( x, y, &quo ); return [ quo, x ]; }36 [ int, float ] remquo( float x, float y ) { int quo; x = remquof( x, y, &quo ); return [ quo, x ]; } 37 37 float remquo( float x, float y, int *quo ) { return remquof( x, y, quo ); } 38 //[ int, double ] remquo( double x, double y ) { int quo; x = remquo( x, y, &quo ); return [ quo, x ]; }39 //[ int, long double ] remquo( long double x, long double y ) { int quo; x = remquol( x, y, &quo ); return [ quo, x ]; }38 [ int, double ] remquo( double x, double y ) { int quo; x = remquo( x, y, &quo ); return [ quo, x ]; } 39 [ int, long double ] remquo( long double x, long double y ) { int quo; x = remquol( x, y, &quo ); return [ quo, x ]; } 40 40 long double remquo( long double x, long double y, int *quo ) { return remquol( x, y, quo ); } 41 41 42 //[ int, float ] div( float x, float y ) { int quo; x = remquof( x, y, &quo ); return [ quo, x ]; }42 [ int, float ] div( float x, float y ) { int quo; x = remquof( x, y, &quo ); return [ quo, x ]; } 43 43 float div( float x, float y, int *quo ) { return remquof( x, y, quo ); } 44 //[ int, double ] div( double x, double y ) { int quo; x = remquo( x, y, &quo ); return [ quo, x ]; }45 //[ int, long double ] div( long double x, long double y ) { int quo; x = remquol( x, y, &quo ); return [ quo, x ]; }44 [ int, double ] div( double x, double y ) { int quo; x = remquo( x, y, &quo ); return [ quo, x ]; } 45 [ int, long double ] div( long double x, long double y ) { int quo; x = remquol( x, y, &quo ); return [ quo, x ]; } 46 46 long double div( long double x, long double y, int *quo ) { return remquol( x, y, quo ); } 47 47 … … 278 278 long double ldexp( long double x, int exp2 ) { return ldexpl( x, exp2 ); } 279 279 280 //[ float, float ] modf( float x ) { float i; x = modff( x, &i ); return [ i, x ]; }280 [ float, float ] modf( float x ) { float i; x = modff( x, &i ); return [ i, x ]; } 281 281 float modf( float x, float *i ) { return modff( x, i ); } 282 //[ double, double ] modf( double x ) { double i; x = modf( x, &i ); return [ i, x ]; }283 //[ long double, long double ] modf( long double x ) { long double i; x = modfl( x, &i ); return [ i, x ]; }282 [ double, double ] modf( double x ) { double i; x = modf( x, &i ); return [ i, x ]; } 283 [ long double, long double ] modf( long double x ) { long double i; x = modfl( x, &i ); return [ i, x ]; } 284 284 long double modf( long double x, long double *i ) { return modfl( x, i ); } 285 285 -
TabularUnified src/libcfa/stdlib.c ¶
r66f8528 r43385ca 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // algorithm.c -- 7 // algorithm.c -- 8 8 // 9 9 // Author : Peter A. Buhr … … 141 141 if ( sscanf( ptr, "%Lf%Lfi", &re, &im ) == EOF ) {} 142 142 return re + im * _Complex_I; 143 } 143 } 144 144 145 145 int strto( const char * sptr, char ** eptr, int base ) { … … 213 213 //--------------------------------------- 214 214 215 //forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )216 //[ T, T ] div( T t1, T t2 ) { return [ t1 / t2, t1 % t2 ]; }215 forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } ) 216 [ T, T ] div( T t1, T t2 ) { return [ t1 / t2, t1 % t2 ]; } 217 217 218 218 //---------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.