Changeset 3d9b5da
- Timestamp:
- Apr 7, 2016, 5:35:36 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 224e52f, 630a82a
- Parents:
- 53ba273
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/rational.c
r53ba273 r3d9b5da 11 11 // Created On : Mon Mar 28 08:43:12 2016 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Wed Apr 6 18:02:02201614 // Update Count : 1913 // Last Modified On : Thu Apr 7 17:25:44 2016 14 // Update Count : 20 15 15 // 16 16 17 17 #include <limits> 18 18 #include <rational> 19 #include <fstream> 19 20 20 21 int main() { -
src/libcfa/limits.c
r53ba273 r3d9b5da 10 10 // Created On : Wed Apr 6 18:06:52 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Apr 6 21:12:17201613 // Update Count : 1 012 // Last Modified On : Thu Apr 7 17:18:45 2016 13 // Update Count : 11 14 14 // 15 15 16 #include <limits>16 #include "limits" 17 17 18 18 // Integral Constants -
src/libcfa/rational
r53ba273 r3d9b5da 10 10 // Created On : Wed Apr 6 17:56:25 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Apr 6 21:51:42201613 // Update Count : 812 // Last Modified On : Thu Apr 7 17:23:36 2016 13 // Update Count : 9 14 14 // 15 15 16 #include <fstream>16 #include "iostream" 17 17 18 18 struct Rational { … … 44 44 double widen( Rational r ); 45 45 Rational narrow( double f, long int md ); 46 ifstream * ?|?( ifstream *is, Rational *r);47 ofstream * ?|?( ofstream *os, Rational r);46 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, Rational * ); 47 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, Rational ); 48 48 49 49 // Local Variables: // -
src/libcfa/rational.c
r53ba273 r3d9b5da 11 11 // Created On : Wed Apr 6 17:54:28 2016 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Wed Apr 6 21:52:16201614 // Update Count : 713 // Last Modified On : Thu Apr 7 17:28:03 2016 14 // Update Count : 12 15 15 // 16 16 17 17 #include "rational" 18 #include <fstream>19 #include <stdlib>18 #include "fstream" 19 #include "stdlib" 20 20 21 21 extern "C" { … … 188 188 } // narrow 189 189 190 ifstream * ?|?( ifstream *is, Rational *r ) { 190 forall( dtype istype | istream( istype ) ) 191 istype * ?|?( istype *is, Rational *r ) { 191 192 long int t; 192 193 is | &(r->numerator) | &(r->denominator); … … 197 198 } // ?|? 198 199 199 ofstream * ?|?( ofstream *os, Rational r ) { 200 forall( dtype ostype | ostream( ostype ) ) 201 ostype * ?|?( ostype *os, Rational r ) { 200 202 return os | r.numerator | '/' | r.denominator; 201 203 } // ?|?
Note: See TracChangeset
for help on using the changeset viewer.