D
D
DDwrt1002019-10-23 09:30:44
Java
DDwrt100, 2019-10-23 09:30:44

In what cases can I get infinity in a float variable?

Good afternoon everyone. I have the following formula in my calculations When streaming, some responses get infinity. I have a suspicion that at some iterations, the value is larger than the float variable can accommodate. Is it so ?
return (float) S / (float) (L- M)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-10-23
@DDwrt100

Print operands in cases where you get infinity.
Most likely LM == 0 at these moments

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question