aboutsummaryrefslogtreecommitdiffstats
path: root/trio/compare.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2004-11-10 19:04:29 +0000
committerMatthias Andree <matthias.andree@gmx.de>2004-11-10 19:04:29 +0000
commit13c27199231cbc2cc83969ada741b95be1cca4d3 (patch)
tree58c32705247dcf031d6f17d8bc8ef78557d74113 /trio/compare.c
parent486bdc6d20c7e7d8c6eeb3124cf845abefcd7d11 (diff)
downloadfetchmail-13c27199231cbc2cc83969ada741b95be1cca4d3.tar.gz
fetchmail-13c27199231cbc2cc83969ada741b95be1cca4d3.tar.bz2
fetchmail-13c27199231cbc2cc83969ada741b95be1cca4d3.zip
Import Trio 1.10 into fetchmail's trunk.
svn path=/trunk/; revision=3995
Diffstat (limited to 'trio/compare.c')
-rw-r--r--trio/compare.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/trio/compare.c b/trio/compare.c
new file mode 100644
index 00000000..3823aa2d
--- /dev/null
+++ b/trio/compare.c
@@ -0,0 +1,53 @@
+#include "trio.h"
+
+#define compare(format, value) printf("FORMAT: %s\n", format); printf("TRIO: "); trio_printf(format,value); printf("\nLIBC: "); \
+printf(format,value); printf("\n\n");
+
+int main()
+{
+ compare("\"%e\"",2.342E+02);
+ compare("\"%10.4e\"",-2.342E-02);
+ compare("\"%11.4e\"",-2.342E-02);
+ compare("\"%12.4e\"",-2.342E-02);
+ compare("\"%13.4e\"",-2.342E-02);
+ compare("\"%14.4e\"",-2.342E-02);
+ compare("\"%15.4e\"",-2.342E-02);
+ compare("\"%16.4e\"",-2.342E-02);
+ compare("\"%16.4e\"",-2.342E-22);
+ compare("\"%G\"",-2.342E-02);
+ compare("\"%G\"",3.1415e-6);
+ compare("%016e", 3141.5);
+ compare("%16e", 3141.5);
+ compare("%-16e", 3141.5);
+ compare("%010.3e", 3141.5);
+
+ compare("*%5f*", 3.3);
+ compare("*%5f*", 3.0);
+ compare("*%5f*", .999999E-4);
+ compare("*%5f*", .99E-3);
+ compare("*%5f*", 3333.0);
+
+ compare("*%5g*", 3.3);
+ compare("*%5g*", 3.0);
+ compare("*%5g*", .999999E-4);
+ compare("*%5g*", .99E-3);
+ compare("*%5g*", 3333.0);
+ compare("*%5g*", 0.01);
+
+ compare("*%5.g*", 3.3);
+ compare("*%5.g*", 3.0);
+ compare("*%5.g*", .999999E-4);
+ compare("*%5.g*", 1.0E-4);
+ compare("*%5.g*", .99E-3);
+ compare("*%5.g*", 3333.0);
+ compare("*%5.g*", 0.01);
+
+ compare("*%5.2g*", 3.3);
+ compare("*%5.2g*", 3.0);
+ compare("*%5.2g*", .999999E-4);
+ compare("*%5.2g*", .99E-3);
+ compare("*%5.2g*", 3333.0);
+ compare("*%5.2g*", 0.01);
+
+ return 0;
+}