From: Frederik Schaffalitzky <fsm@ro...>  20020904 15:05:49

The definition of vcl_sqrt or std::sqrt in vnl_bignum.h is illformed, as Bill's client pointed out recently in connection with std::complex and STLPORT. We are not allowed to add more sqrt() signatures to std:: So vcl_sqrt() for vnl_bignum must be removed or renamed. Does that solve the problem? I didn't understand what the problem with sqrt() for VCx.y was. If you are saying that vcl_sqrt(double) returns a long double then that vcl_sqrt() is wrong: it could and should be fixed in vcl. long double is unlikely to unavailable on any compiler that we support. Of course, on some architectures it is 128 bits wide (Sparc) and on some it is 96 bits (80x86), which is a problem if we expect "long double" to be binary exchangeable across architectures.... Let's not have that discussion again. The IEEE format allows for any length of mantissa and exponent but only a few combinations are common. I can't remember if the vsl people eventually decided to implement I/O of arbitrary length integers but one could do something like that for IEEE floating point values. Frederik On Wed, 4 Sep 2002, Amitha Perera wrote: > In trying to clean up vcl code for VC70, we've come across problems > relating to the long double type. In particular, the VC70 standard > library seems notsobroken that it only requires a few patches in > vcl/win32/* (actually, VC60sp5 seems to be similar...). The problem is > that the VC70 implementation of some of the math functions uses long > double constants (e.g. in the sqrt function). This creates problems > when trying to instantiate vnl_bignum because there is no constructor > taking a long double as an argument. While there is, no doubt, a > reasonable work around for this particular problem, it is indicative > of a bigger problem: inconsistent and incomplete support for long > double in vnl. > > The C++ standard explicitly has a long double type. On some platforms, > it is bigger than double. (On FreeBSD with gcc, it is 96 bits.) Is > there a clean way of getting long double support into > vnl_math.{h,cxx}? From there, it should be relatively straight forward > to propagate to the rest of vnl. > > I must admit lack of experience with this level of detail in floating > point representations, etc. Can any vnl gurus comment? > > On a side note: the comment in vnl_math says that vnl_math::maxdouble > (and relatives) are only there until there is support for numeric > traits. It would seem that we now have widespread support for numeric > traits, in terms of complete specialization. Should > vnl_math::maxdouble be moved into traits? > > Amitha. > > >  > This sf.net email is sponsored by: OSDN  Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Vxlmaintainers mailing list > Vxlmaintainers@... > https://lists.sourceforge.net/lists/listinfo/vxlmaintainers > 