When ever I am trying to do the following in python(compiler that comes in built in mac) 6.0%1.0 , I am getting 0.999999999999 . How to get the answer as 0.0
Here is the code :-
values=30.24
alist=list()
boolean=0
count=0
print 'start'
while(boolean==0):
print 'before entering',values
print 'values%1' , (values%1)
if(values%(1.0)==0.0):
boolean=1;
alist.append(int(values))
count=count+1;
svalues=(values)-(alist[count-1])
print svalues,alist[count-1],count
values=svalues
if(values==0.0):
boolean=1;
else:
values=1/(values)
print 'end'