[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: command log(2) give value as 500

**From**: |
Przemek Klosowski |

**Subject**: |
Re: command log(2) give value as 500 |

**Date**: |
Mon, 12 Feb 2018 13:23:14 -0500 |

**User-agent**: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |

On 02/12/2018 09:29 AM, behindvampire wrote:

Hi all,I am new to this octave world so please bear my foolish question.i am
trying to find the natural log value of 2 but the value it generate is
500.

Normally, log() is the function:
octave:1> which log
'log' is a built-in function from the file libinterp/corefcn/mappers.cc
octave:1> log(2)
ans = 0.69315

`but you can define your own data array called log() which will then
``shadow the log() function:
`
octave:2> log(1)=1
log = 1
octave:3> log(2)
error: log(2): out of bound 1octave:3> log(e)

`error: log(2.71828): subscripts must be either integers 1 to (2^31)-1 or
``logicals
`octave:3> which log
'log' is a variable

`If you can remember defining data that shadows the log() function,
``great---if not, it could be some code that is automatically loaded in
``your environment and it would require some investigation to figure out
``where it's coming from.
`