#include "cl_sysdep.h"
// Specification.
-#include "cl_sfloat.h"
+#include "cln/sfloat.h"
// Implementation.
#include "cl_SF.h"
#include "cl_F.h"
-const cl_SF scale_float (const cl_SF& x, sintL delta)
+namespace cln {
+
+const cl_SF scale_float (const cl_SF& x, sintC delta)
{
// Methode:
// x=0.0 -> x als Ergebnis
SF_decode(x, { return x; }, sign=,exp=,mant=);
if (delta >= 0)
// delta>=0
- { var uintL udelta = delta;
+ { var uintC udelta = delta;
if (udelta <= (uintL)(SF_exp_high-SF_exp_low))
{ exp = exp+udelta;
return encode_SF(sign,exp,mant);
}
else
- { cl_error_floating_point_overflow(); }
+ { throw floating_point_overflow_exception(); }
}
else
// delta<0
- { var uintL udelta = -delta;
+ { var uintC udelta = -delta;
if (udelta <= (uintL)(SF_exp_high-SF_exp_low))
{ exp = exp-udelta;
return encode_SF(sign,exp,mant);
}
else
if (underflow_allowed())
- { cl_error_floating_point_underflow(); }
+ { throw floating_point_underflow_exception(); }
else
{ return SF_0; }
}
}
+
+} // namespace cln