TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Paul Colin Gloster <[log in to unmask]>
Tue, 22 Feb 2005 18:47:05 +0100
text/plain (29 lines)
Dear Art,

I hope you do not mind the significant delay in my response.

On Wed, Jan 26, 2005 at 05:45:34PM -0800, Art Vanden Berg wrote:
"[..]

As things turned out, the only onboard software bug that caused any problem 
was a single case of forgetting to use fabs(float) in one conditional line.

[..]"

Just one bug in C is impressive. Congratulations.

As for would this have happened in Ada?: a positive real data type could 
have been used such that forgetting to get its absolute value would not 
have been an issue: but perhaps you would have forgotten to declare such a 
type (however, if you needed to use fabs() more than once, then there is 
already a bonus in simply declaring positive floating point numbers 
without having to remember to apply the absolute conversion logic every 
time), but depending on your needs perhaps a negative real value was 
meaningful for the variable in your bug in other parts of the code in 
which case you might not have been so lucky that a compile time error 
message would have saved you instead of a runtime problem with C, but it 
depends.

Regards,
Colin Paul

ATOM RSS1 RSS2