[sac-user] print function alternatives?

Herhut, Stephan s.a.herhut at herts.ac.uk
Mon Aug 2 19:15:32 CEST 2010

Dear Michael,

we have a module called ArrayFormat that was contributed by Robert Bernecky. It uses a formatting scheme das guarantees not to loose precision or, if precision is lost, to at least make this visible in the output. I do not know the current state of that module, though. Maybe Bob can be of help here.

With respect to your request: This feature could certainly be made available. I checked the implementation in the standard library and the current implementation uses "%4f " for floats. However, I would prefer a more generic solution as implemented by ArrayFormat. I will bring this up during our next developer's meeting.


On 02/08/2010 17:20, "Bullington, Michael" <michael.bullington at ttu.edu> wrote:

To whom it shall concern:

I was tracing some logic errors on a program that would perform Singular Value Decomposition (SVD) and was using the print function to print values in tracking the logic errors.  However, I had to resort to more "standard" printf functions using %30.15f format strings (up to 15 decimal places) to discover I had computation round-off errors.  The round-off errors became extremely deceptive when the print function was used in tracking the errors because the rounding gave output the appearance of correctness.  The print function in SAC seems to just use the "standard" %f format string which has a default of 6 decimal places.

Is there an alternative (overloaded) form of the print function in SAC where I can control some of the output formatting and not have to resort to printf?

Stephan Herhut
Centre for Computer Science and Informatics Research
Science and Technology Research Institute
University of Hertfordshire

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sac-home.org/pipermail/sac-user/attachments/20100802/a3f8525c/attachment-0002.html>

More information about the sac-user mailing list