Logo Search packages:      
Sourcecode: apertium version File versions  Download package

void EndianDoubleUtil::write ( ostream &  os,
double const &  val 
) [static]

Write procedure, C++ I/O version.

Parameters:
output the stream to write to
val the value of the generic object to write to the stream

Definition at line 78 of file endian_double_util.cc.

{
  double val2 = val;
#ifdef WORDS_BIGENDIAN
  os.write(reinterpret_cast<char *>(&val2), sizeof(double));
#else
  char *s = reinterpret_cast<char *>(&val2);
    
  for(int i = sizeof(double)-1; i != -1; i--)
  {
    os.write(&(s[i]), sizeof(char));
  }
#endif
}


Generated by  Doxygen 1.6.0   Back to index