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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why 2+2 dont make 4 in clipper???

Status
Not open for further replies.

mannucci

Programmer
Oct 14, 2002
2
IT
i have a problem with matematical operation, i have two variable that inspected with the debugger say me a value but if clipper make the sum of the two variable the result is incorrect. how i can fix? i try to convert with str( and back with val( but is the same. Please help.
 
They may be large values of 2.
[lol]

Just kidding, there was an old joke of "2+2=5 for extremely large values of 2".

I do not know how to help for real.
These are the only things I use:
val(alltrim(amt))
STR(SEQ,3,0)

Kris
 
What are the values? What do you get? What version of Clipper? Ian Boys
DTE Systems Ltd
 
version is Clipper 5.2d
varius value, very big like 12,4 numeber all used

 
The problem with aritmetic operations is that Clipper uses always real numbers. You must use Round(number,decpos) to adjust your number to the appropriate result.

Sometimes there is a "magic number" that is just typed and the internal result is different. I suppose that in a very large calculus program this procedure will produce a great overhead.

Ulisses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top