Compiling SPECFUN and similar libraries



Hi,

I often find in libraries downloaded from Netlib that some lines start
with CS or CD, like this:

CS REAL
CD DOUBLE PRECISION

To compile a single/double precision version of the code, all
occurences of CS/CD in the first two columns must be changed to
blanks. How can I do this automatically? Most text editors can replace
a string with another, also specifying that the first string must be a
whole word (in this way I avoid eliminating occurences of CS/CD inside
bigger strings) but I'd prefer to explicitly specify that CS/CD must
occur in the first two columns of a line. Maybe I want to be a bit too
safe :-) but since I have seen this "trick" so often in many
libraries, I was wondering if there is some standard Unix utility
which is commonly used to do this.

Best Regards,

deltaquattro
.



Relevant Pages

  • Re: Compiling SPECFUN and similar libraries
    ... To compile a single/double precision version of the code, ... a string with another, also specifying that the first string must be a ... whole word (in this way I avoid eliminating occurences of CS/CD inside ...
    (comp.lang.fortran)
  • Re: Why (0.09+0.01-0.1) is not equal to 0.09+0.01-0.1 ?
    ... > gives full accuracy by default, but also includes rounding algorithms ... > partitioned mantissa by without risk of overflow ... > Function D2BAs String ... the work involved in avoiding lost precision due to type ...
    (microsoft.public.excel)
  • Re: Precision vs. Accuracy and Significant Figures
    ... String category; ... add(UnitOfMeasure, UnitOfMeasure); ... units and just spit out an answer to the proper precision if all the ... gives more information than dealing with significant digits. ...
    (comp.lang.java.advocacy)
  • Re: Converting double to widestring
    ... An alternative, if this function is called in a tight loop in one place, is to only let the function resize the string and optimize at the caller site, where the same string variable should then be re-used repeatedly. ... Given that the _cfltcvt function is practically unavailable, I suggest plain wsprintf, which doesn't really add that much extra processing, only a little. ... Note that your function signature has long precision, and that that is most probably extreme overkill and Bad Design, but that to get rid of the dynamic allocation for wstring the signature may need to be adjusted anyway -- and I'd also suggest fixing the name, which says nothing whatsoever. ...
    (microsoft.public.vc.language)
  • Re: Why (0.09+0.01-0.1) is not equal to 0.09+0.01-0.1 ?
    ... However less precision would suffice, since 17 digits would uniquely identify an IEEE double precision binary representation. ... Function D2BAs String ... You can use the VBA Decimal data type to carry 28 figures, but you have to be careful to avoid truncation in type conversions and to avoid overflow or underflow since the Decimal data type has fixed precision with no scientific notation. ...
    (microsoft.public.excel)