13 cl_private_thing cl_float_to_FF_pointer (const ffloatjanus& val_)
15 var ffloat val = val_.eksplicit;
16 var uintL exp = (val >> FF_mant_len) & (bit(FF_exp_len)-1); // e
17 if (exp == 0) // e=0 ?
18 // vorzeichenbehaftete 0.0 oder subnormale Zahl
19 { if (!((val << 1) == 0) && underflow_allowed())
20 { cl_error_floating_point_underflow(); }
22 { return as_cl_private_thing(cl_FF_0); } // +/- 0.0 -> 0.0
24 elif (exp == 255) // e=255 ?
25 { if (!((val << (32-FF_mant_len)) == 0))
26 { cl_error_floating_point_nan(); } // NaN
28 { cl_error_floating_point_overflow(); } // Infinity, Overflow
31 { // Der Exponent muß um FF_exp_mid-126 erhöht werden.
32 if ((FF_exp_mid>126) && (exp > FF_exp_high-FF_exp_mid+126))
33 { cl_error_floating_point_overflow(); } // Overflow
34 val += (FF_exp_mid - 126) << FF_mant_len;
35 #if defined(CL_WIDE_POINTERS)
36 return as_cl_private_thing(allocate_ffloat(val));
38 return (cl_private_thing)allocate_ffloat(val);