how can I write a test case to compare infinity value?

Neha :

how can I write a test case to compare infinity value. Example 10/0.0 results infinity how can i write following for it

assertThat(<**what will be here?**>).isCloseTo(10/0.0);
xingbin :

How about

assertTrue(Double.isInfinite(10/0.0))

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=93041&siteId=1