M
M
Mushkiter0072017-09-26 09:44:54
Delphi
Mushkiter007, 2017-09-26 09:44:54

Very simple code. Why doesn't if work?

if ((frac(N/N1)=0)
That's actually the whole code, where N and N1 Real. Who can explain why when N=1 and N1=0.5 the if statement is executed, but not when N=1 and N1=0.2 ?What do I need to know?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2017-09-26
@gbg

What you need to know about floating point arithmetic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question