* Changed all copyright messages to include 1993.
* Stubs for faster implementation of local variables (not yet finished)
* Added function name to code object.  Print it for code and function
  objects.  THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version
  number has changed accordingly)
* Print address of self for built-in methods
* New internal functions getattro and setattro (getattr/setattr with
  string object arg)
* Replaced "dictobject" with more powerful "mappingobject"
* New per-type functio tp_hash to implement arbitrary object hashing,
  and hashobject() to interface to it
* Added built-in functions hash(v) and hasattr(v, 'name')
* classobject: made some functions static that accidentally weren't;
  added __hash__ special instance method to implement hash()
* Added proper comparison for built-in methods and functions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index e563583..8533e0e 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -145,6 +145,38 @@
 	return (i < j) ? -1 : (i > j) ? 1 : 0;
 }
 
+static long
+float_hash(v)
+	floatobject *v;
+{
+	double intpart, fractpart;
+	int expo;
+	long x;
+	/* This is designed so that Python numbers with the same
+	   value hash to the same value, otherwise comparisons
+	   of mapping keys will turn out weird */
+	fractpart = modf(v->ob_fval, &intpart);
+	if (fractpart == 0.0) {
+		if (intpart > 0x7fffffffL || -intpart > 0x7fffffffL) {
+			/* Convert to long int and use its hash... */
+			object *w = dnewlongobject(v->ob_fval);
+			if (w == NULL)
+				return -1;
+			x = hashobject(w);
+			DECREF(w);
+			return x;
+		}
+		x = (long)intpart;
+	}
+	else {
+		fractpart = frexp(fractpart, &expo);
+		x = (long) (intpart + fractpart) ^ expo; /* Rather arbitrary */
+	}
+	if (x == -1)
+		x = -2;
+	return x;
+}
+
 static object *
 float_add(v, w)
 	floatobject *v;
@@ -378,4 +410,5 @@
 	&float_as_number,	/*tp_as_number*/
 	0,			/*tp_as_sequence*/
 	0,			/*tp_as_mapping*/
+	float_hash,		/*tp_hash */
 };