diff utils.h @ 144:be87c8e78266

Code cleanup
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Wed, 22 Jan 2014 14:45:24 +0100
parents
children 97112b45b838
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/utils.h	Wed Jan 22 14:45:24 2014 +0100
@@ -0,0 +1,36 @@
+#ifndef __FXANALISE_UTILS_H__
+#define __FXANALISE_UTILS_H__
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef MIN
+#define MIN(x, y) (x) < (y) ? (x) : (y)
+#endif
+
+/* format floating points numbers accordingly to fmt and asdd thousands separator */
+const char * thousands(char *buffer, int size, char *fmt, double val);
+
+/* MJD functiom used by the Sr programs */
+static inline double utc2mjd(double utc)
+{
+	return 15020.0 + utc / 86400.0;
+}
+
+double Peta(double x);
+double Tera(double x);
+double Giga(double x);
+double Mega(double x);
+double kilo(double x);
+double milli(double x);
+double micro(double x);
+double nano(double x);
+double pico(double x);
+double femto(double x);
+double atto(double x);
+
+#endif