using Gee; uint hash_func (void* num) { return str_hash (((double?)num).to_string ()); } bool eql_func (void* num1, void* num2) { return *((double*)num1) == *((double*)num2); } static int main (string[] args) { double? first = 0.0; double? second = 0.0; stdout.printf ("Direct hash for first: %u\n", direct_hash ((void*) first)); stdout.printf ("Hash for first: %u\n", hash_func ((void*) first)); stdout.printf ("Direct hash for second: %u\n", direct_hash ((void*) second)); stdout.printf ("Hash for second: %u\n", hash_func ((void*) second)); stdout.printf ("Reference equal: %s\n", direct_equal ((void*) first, (void*) second) ? "yes" : "no"); stdout.printf ("Equal: %s\n", eql_func ((void*) first, (void*) second) ? "yes" : "no"); var map = new HashMap (hash_func, eql_func, eql_func); map.set (0.0, 0.0); var val = map[0.0]; if (val == null) { stdout.printf ("Value is null!\n"); } else { stdout.printf ("Value: %f\n", val); } return 0; }