public static boolean[] fromFloat(double d, int widthV, int widthP) {
			boolean s;
			boolean[] v,p;			
			v = new boolean[widthV];
			p = new boolean[widthP];
			s = d < 0;
			if (d == 0) {
				for(int i  = 0; i < widthV; ++i)
					v[i] = false;
				for(int i  = 0; i < widthP; ++i)
					p[i] = false;
				p[widthP-1]=true;
			} else {
			d = s ? -1*d:d;
			int pInt = 0;
			
			double lower_bound = Math.pow(2, widthV-1);
			double upper_bound = Math.pow(2, widthV);
			while(d < lower_bound) {
				d*=2;
				pInt--;
			}
			
			while(d >= upper_bound) {
				d/=2;
				pInt++;
			}
			
			p = Utils.fromInt(pInt, widthP);
			long tmp = (long) (d+0.000001);//a hack...
			v = Utils.fromLong(tmp, widthV);
			}
			boolean[] result = new boolean[1+widthV+widthP];
			result[0] = s;
			System.arraycopy(v, 0, result, 1, v.length);
			System.arraycopy(p, 0, result, 1+v.length, p.length);
			return result;
		}