From 13c27199231cbc2cc83969ada741b95be1cca4d3 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Wed, 10 Nov 2004 19:04:29 +0000 Subject: Import Trio 1.10 into fetchmail's trunk. svn path=/trunk/; revision=3995 --- trio/compare.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 trio/compare.c (limited to 'trio/compare.c') 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; +} -- cgit v1.2.3