X-Git-Url: https://ginac.de/CLN/cln.git//cln.git?a=blobdiff_plain;f=src%2Ffloat%2Fmisc%2Fcl_F_mostneg.cc;h=674d5370c48e9c7dab8c8137f5854eb0ca7e2194;hb=HEAD;hp=ca1d467114649bcb08c07fcd9132863fbb68a0a4;hpb=c84c6db5d56829d69083c819688a973867694a2a;p=cln.git diff --git a/src/float/misc/cl_F_mostneg.cc b/src/float/misc/cl_F_mostneg.cc index ca1d467..674d537 100644 --- a/src/float/misc/cl_F_mostneg.cc +++ b/src/float/misc/cl_F_mostneg.cc @@ -1,40 +1,23 @@ // most_negative_float(). // General includes. -#include "cl_sysdep.h" - -CL_PROVIDE(cl_F_mostneg) +#include "base/cl_sysdep.h" // Specification. #include "cln/float.h" // Implementation. -#include "cl_F.h" -#include "cl_SF.h" -#include "cl_FF.h" -#include "cl_DF.h" -#include "cl_LF.h" -#include "cl_LF_impl.h" +#include "float/cl_F.h" +#include "float/sfloat/cl_SF.h" +#include "float/ffloat/cl_FF.h" +#include "float/dfloat/cl_DF.h" +#include "float/lfloat/cl_LF.h" +#include "float/lfloat/cl_LF_impl.h" namespace cln { -// Exponent so groß wie möglich, Mantisse 1...1, Vorzeichen -. - -static const cl_SF most_negative_SF = - make_SF(-1,SF_exp_high,bit(SF_mant_len+1)-1); - -static const cl_FF most_negative_FF = - encode_FF(-1,FF_exp_high-FF_exp_mid,bit(FF_mant_len+1)-1); - -static const cl_DF most_negative_DF = -#if (cl_word_size==64) - encode_DF(-1,DF_exp_high-DF_exp_mid,bit(DF_mant_len+1)-1); -#else - encode_DF(-1,DF_exp_high-DF_exp_mid,bit(DF_mant_len-32+1)-1,bitm(32)-1); -#endif - -inline const cl_LF most_negative_LF (uintC len) +static inline const cl_LF most_negative_LF (uintC len) { var Lfloat erg = allocate_lfloat(len,LF_exp_high,-1); fill_loop_up(&TheLfloat(erg)->data[0],len,~(uintD)0); @@ -43,6 +26,21 @@ inline const cl_LF most_negative_LF (uintC len) const cl_F most_negative_float (float_format_t f) { + // Exponent so groß wie möglich, Mantisse 1...1, Vorzeichen -. + + static const cl_SF most_negative_SF = + make_SF(-1,SF_exp_high,bit(SF_mant_len+1)-1); + + static const cl_FF most_negative_FF = + encode_FF(-1,FF_exp_high-FF_exp_mid,bit(FF_mant_len+1)-1); + + static const cl_DF most_negative_DF = +#if (cl_word_size==64) + encode_DF(-1,DF_exp_high-DF_exp_mid,bit(DF_mant_len+1)-1); +#else + encode_DF(-1,DF_exp_high-DF_exp_mid,bit(DF_mant_len-32+1)-1,bitm(32)-1); +#endif + floatformatcase((uintC)f , return most_negative_SF; , return most_negative_FF; @@ -53,4 +51,3 @@ const cl_F most_negative_float (float_format_t f) } // namespace cln -CL_PROVIDE_END(cl_F_mostneg)