Logarithm function

Hello to everyone,I'm using a Borland BCC55 compiler to describe the logarithm function.
It works fine,but only with numbers higher than 1,if I insert any floating point the result stucks on -46,whatacer number <1 I write.
Here is the function,I made it myself (on a text host):http://freetexthost.com/kv0rdi4gno
Of course I have to do it with only the stdio.h library,no math.h or it's like cheating.
Anyone explain me why I get this "-46" and how to fix it?
Here's the image,please help me !!http://img28.imageshack.us/img28/5259/catturados.png

Post your code here instead of posting a link on some other computer -- which would not respond when I tried to read it. Just simply copy and paste the code in your post and surround it with
[code]
...
[/code] code tags.

What happens when you compare the float i with the int n? That seems to be the only place where it could be going wrong.

I suggest that you instrument after line 26 with printf("m=%d, n=%d, i=%f, p = %f\n",m,n,i,p); . You might also want to print out the boolean that is the stop condition. Be sure to add curly braces around the body of the loop.

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...