<div dir="ltr"><div>log() in math.h only supports float or double type. float and double are limited in the range of numbers they can express. For example, these types cannot hold large numbers like "99999999999999999999999999999999999999999". Depending on your purpose, float and double may be sufficient, and you can use log() from math.h and link with -lm.</div><div><br></div><div>If you require logarithms of large numbers, you'll have to resort to a library that supports this, like the one I linked to.</div><div><br></div><div>Alternatively, you can implement a logarithm extension to OpenSSL's bignum library using existing bignum functions.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 24, 2019 at 7:02 PM Niklas Niere <<a href="mailto:nniklas@mail.uni-paderborn.de">nniklas@mail.uni-paderborn.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>Thank you for the answer. We are using the Makefile from OpenSSL
to compile our feature as it changes OpenSSL directly. As I
understood it, we would have to import another number library to
compile our code with the standard OpenSSL settings and using the
logarithm, correct?</p>
<div class="gmail-m_1047644201907070088moz-cite-prefix">On 2019-07-24 6:51 p.m., Guido Vranken
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>If you want to use the log() from math.h, then you must
compile with -lm, eg.: clang source.c -lm</div>
<div><br>
</div>
<div>The log() in math.h only supports floating point numbers.
If you require computing logarithms of bignums, try <a href="https://www.mpfr.org/" target="_blank">https://www.mpfr.org/</a></div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jul 24, 2019 at 6:39
PM Niklas Niere <<a href="mailto:nniklas@mail.uni-paderborn.de" target="_blank">nniklas@mail.uni-paderborn.de</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
we are implementing a TLS 1.3 feature into OpenSSL to get an
idea of how <br>
well our feature performs in a concrete server library. In the
feature, <br>
we want to use the log function.<br>
<br>
When we try to use the log function from the math.h header,
OpenSSL <br>
won't compile with the statement that 'log' is a reference to
an <br>
undefined function. The BigNum library from OpenSSL does also
not seem <br>
to offer a log function.<br>
<br>
We suspect that the compile error comes from the fact that
OpenSSL is <br>
C90 compatible but are unsure. Does anyone know how to compute
the <br>
logarithm of a number in OpenSSL?<br>
<br>
Thanks,<br>
Niklas<br>
<br>
</blockquote>
</div>
</blockquote>
</div>
</blockquote></div>