Monday, November 22, 2010

DIY Scatter plot screenshot

No real tip, but I'm doing Visual Analytics this semester at Tufts and I spent unnecessary amount of time just to get this far. This is a rendering of the Iris data set from UCI.

Wednesday, November 10, 2010

How to do modulus with floats and doubles in C

You may be tempted to use the '%' operator but that's only for integers.
To do modulus arithmetic with doubles and floats use the math.h library.
Use the following functions:

double fmod(double x, double y);
float fmodf(float x, float y);
long double fmodl(long double x, long double y);

Use -lm to link to the library.