Ignore:
Timestamp:
Feb 8, 2016, 10:07:42 AM (10 years ago)
Author:
Thierry Delisle <tdelisle@…>
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, with_gc
Children:
c44e622
Parents:
00ede9e (diff), bd85400 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into gc_noraii

File:
1 moved

Legend:

Unmodified
Added
Removed
  • src/libcfa/iostream.c

    r00ede9e rd41280e  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jan  4 09:38:58 2016
    13 // Update Count     : 37
     12// Last Modified On : Mon Feb  1 14:20:30 2016
     13// Update Count     : 60
    1414//
    1515
    16 #include "iostream.h"
     16#include "iostream"
     17
    1718extern "C" {
    1819#include <stdio.h>
    1920#include <string.h>                                                                             // strlen
     21#include <complex.h>                                                                    // creal, cimag
    2022}
    2123
     
    6264
    6365forall( dtype ostype | ostream( ostype ) )
     66ostype * ?|?( ostype *os, float f ) {
     67        char buffer[32];
     68        return write( os, buffer, sprintf( buffer, "%g", f ) );
     69} // ?|?
     70
     71forall( dtype ostype | ostream( ostype ) )
    6472ostype * ?|?( ostype *os, double d ) {
    6573        char buffer[32];
     
    7179        char buffer[32];
    7280        return write( os, buffer, sprintf( buffer, "%Lg", d ) );
     81} // ?|?
     82
     83forall( dtype ostype | ostream( ostype ) )
     84ostype * ?|?( ostype *os, float _Complex c ) {
     85        return os | crealf( c ) | (cimagf( c ) < 0 ? "" : "+") | cimagf( c ) | 'i';
     86} // ?|?
     87
     88forall( dtype ostype | ostream( ostype ) )
     89ostype * ?|?( ostype *os, double _Complex c ) {
     90        return os | creal( c ) | (cimag( c ) < 0 ? "" : "+") | cimag( c ) | 'i';
     91} // ?|?
     92
     93forall( dtype ostype | ostream( ostype ) )
     94ostype * ?|?( ostype *os, long double _Complex c ) {
     95        return os | creall( c ) | (cimagl( c ) < 0 ? "" : "+") | cimagl( c ) | 'i';
    7396} // ?|?
    7497
Note: See TracChangeset for help on using the changeset viewer.