finite-precision

Is it safe to use floats as keys of hashtables?

I need to store pairs of float,int in which the int value stores the number of occurrences of a float value inside a model I'm using for a tool I'm developing and I was wondering if it's safe to do such things.. Finite precision should be an issue when talking floats used to direct comparisons (or as content to be hashed) so I think tha...

How to optimize this computation

Hello, I'm writing a model-checker which relies on the computation of a coefficient which is used intensively by the algorithms which is the following: where q is double, t a double too and k an int. e stands for exponential function. This coefficient is used in steps in which q and t don't change while k always starts from 0 until th...