ULP calculation floating-point
<p>I'm currently writing a "new language" at school, and I have to implement a Math class.</p>

<p>One of the specifications is to implement ulp method, like Math.ulp() in Java. We are working on float types.</p>

<p>I found many interesting sources, but I'm still not able to calculate ulp of a float..</p>

<p>AFAIK, if</p>

<p><a href="https://i.stack.imgur.com/QiljO.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QiljO.gif" alt="normalized x"></a></p>

<p>then </p>

<p><a href="https://i.stack.imgur.com/40Cou.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/40Cou.gif" alt="ulp equation"></a></p>

<p>But, how can I get this normalized form for a float without any lib ? 
And how to get parameters e &amp; n+1 ? </p>

<p>Thank you for your help,</p>

<p>Best regards,</p>