#include <stdio.h>#include <string.h>#include "doc_Text.hh"#include "compatibility.hh"#include <string>#include <vector>#include <iostream>#include <sstream>#include <assert.h>#include "floats.hh"Go to the source code of this file.
Functions | |
| string | scientific2tenpow (double n) |
| string | docT (char *c) |
| string | docT (int n) |
| string | docT (long n) |
| string | docT (double n) |
| Add a trailing f when converting double-precision numbers to text if single-precision is required NO, this is no more true for LaTeX documentator. | |
Variables | |
| bool | gInternDoubleSwitch |
| string docT | ( | double | n | ) |
Add a trailing f when converting double-precision numbers to text if single-precision is required NO, this is no more true for LaTeX documentator.
Definition at line 84 of file doc_Text.cpp.
References scientific2tenpow().
00085 { 00086 // char c[64]; 00087 // if (n < 0.1 && n > -0.1 && n != 0.0) { 00088 // //snprintf(c, 63, "%e", n); //, inumix()); 00091 // snprintf(c, 63, "%g", n); 00092 // } else { 00093 // snprintf(c, 63, "%g", n); 00094 // //zdel(c); 00095 // } 00096 // return string(c); 00097 return scientific2tenpow(n); 00098 }
| string docT | ( | long | n | ) |
Definition at line 61 of file doc_Text.cpp.
| string docT | ( | int | n | ) |
Definition at line 60 of file doc_Text.cpp.
| string docT | ( | char * | c | ) |
Definition at line 59 of file doc_Text.cpp.
Referenced by DocCompiler::compileLateq(), DocCompiler::generateCode(), DocCompiler::generateIota(), DocCompiler::getFreshID(), and DocCompiler::prepareIntervallicUI().
| string scientific2tenpow | ( | double | n | ) |
Definition at line 100 of file doc_Text.cpp.
Referenced by docT().
00101 { 00102 char tmp[64]; 00103 string entree = " * 10^{"; 00104 char sortie = '}'; 00105 string s; 00106 string::size_type ps; 00107 00108 snprintf(tmp, 63, "%g", n); 00109 00110 //cerr << "doc_Text.cpp : scientific2tenpow : " << n << " -> \"" << tmp << "\"" << endl; 00111 s = tmp; 00112 ps = s.find('e'); 00113 00114 if (ps != string::npos) { 00115 s.replace(ps, 1, ""); 00116 s.insert(ps, entree); 00117 s += sortie; 00118 } 00119 else { 00120 //cerr << "doc_Text.cpp : scientific2tenpow : \'e\' non trouvé" << endl; 00121 } 00122 00123 return s; 00124 }
| bool gInternDoubleSwitch |
1.6.3