#include <windows.h>
#include <stdio.h>
#include "..\m_apm.h"
// Syntax: LOG2 x d(ecimal precision)
INT main ( INT argc, LPSTR *argv )
{
if ( argc != 3 ) return 0;
INT dp = atoi(argv[2]); // decimal places
MAPM m_x(argv[1]);
MAPM m_Two(2);
MAPM m_log2ofx = (m_x.log(dp+3) / m_Two.log(dp+3)).round(dp+2);
CHAR *szResult = (CHAR*) malloc(m_log2ofx.significant_digits() + dp + 3);
m_log2ofx.toFixPtString(szResult, dp);
printf("%s\n", szResult);
free(szResult);
return 0;
}