Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loss of accuracy using fabs

Status
Not open for further replies.

Maurader

Technical User
May 8, 2002
59
CA
I have the following simple code

double number1;
double number2 = .000000001;
number1 = fabs(number2);

and i get number1 as zero

can any body help me with why i'm losing the accuracy?

Thanks!
 
How are you determining the number is zero? What you have written will assign 1.0e-09 to number1 not zero. Maybe you are losing accuracy in your display.

HTH,
JC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top