Welcome Guest. Please Login or Register. Apr 1st, 2018, 05:24am
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. We apologize Conforums does not have any export functions to migrate data. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
Re: maths problem
« Reply #3 on: Apr 21st, 2015, 08:46am »
Code:
precision = 1e-5
hkval = 50000*.60
valueD = hkval/1000
valueC = int(valueD)
if valueC < valueD-precision then
print "definitely less"
else
print "approximately same or more"
end if
so how do I apply it in my example code? is there a possible way?
What is the problem you are trying to solve? Your code, as it stands, appears to be trying to check whether or not valueD is an integer. It is giving the correct result, because in this case valueD is actually:
LBB performs its floating-point calculations to considerably greater accuracy than JB or LB (about 19 significant figures compared with about 16) but small differences of this kind are unavoidable unless you use only integer arithmetic.