sanchahar / speedcrunch

Automatically exported from code.google.com/p/speedcrunch
1 stars 0 forks source link

Add logbase function #486

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
A logbase function allows using a number other than 10 or 2 as the base. It can 
be useful for getting the exponent that a number has been raised by (aka. the 
inverse operation of raising a number to a power).
Suggested expression implementations (the former [<<] may be easier to 
understand):
* logbase(x, base) <<
* logbase(base, x)
Example problems:
* logbase(512, 8) = 3
* logbase(64, 2) = 6

Original issue reported on code.google.com by richWiki101@gmail.com on 28 Feb 2014 at 10:59

GoogleCodeExporter commented 8 years ago
Thanks for your feedback. Now that I think about it, this is how I think we 
should have it (according to ISO): 
https://en.wikipedia.org/wiki/Logarithm#Particular_bases

And then, we'd finally have log(x, base). What do you think?

Original comment by helder.p...@gmail.com on 1 Mar 2014 at 12:03

GoogleCodeExporter commented 8 years ago
Also: 
http://en.wikipedia.org/wiki/ISO_31-11#Exponential_and_logarithmic_functions

Original comment by helder.p...@gmail.com on 1 Mar 2014 at 12:05

GoogleCodeExporter commented 8 years ago
I think I may be OK with what you suggest, but I have just a few concerns to 
address:

* What will happen if someone wants to do only log(x)? Will an error result if, 
after you implement your suggestion, one inputs only log(x)?
* Or will this expression be moved to a new one (Such as lb(x) needs to become 
the new binary logarithm, so that lg(x) can become the new logarithm)?
* If you do implement what you suggested, I feel like that some confusion may 
arise for some users, so you may need to document this change somewhere, such 
as a changelog.

Original comment by richWiki101@gmail.com on 1 Mar 2014 at 1:07

GoogleCodeExporter commented 8 years ago
Just like the ISO standard, there would be no log with only one argument. The 
application already tells the user on-the-fly about function usage. log(x) 
would not be accepted and the users would know why. Also, the next version will 
come with a user manual where all this would be documented, of course.

Original comment by helder.p...@gmail.com on 1 Mar 2014 at 1:14

GoogleCodeExporter commented 8 years ago
Finally, if you type just "l", the completion box will hint you about the 
changes, since you'll see the new names and descriptions immediately.

Original comment by helder.p...@gmail.com on 1 Mar 2014 at 1:15

GoogleCodeExporter commented 8 years ago
Okay now, I WILL LET YOU implement your suggestion. I raised my concern earlier 
not for just myself but for other people who may be ignorant. I trust that the 
users will be informed of these changes by the next release.

Original comment by richWiki101@gmail.com on 1 Mar 2014 at 2:26

GoogleCodeExporter commented 8 years ago
Browsing older entries on this tracker lead me to issue 381 which asks for ISO 
notation.

Original comment by helder.p...@gmail.com on 1 Mar 2014 at 2:35

GoogleCodeExporter commented 8 years ago
Function log(base; x) added in revision 2ee3d586.

Original comment by helder.p...@gmail.com on 6 Mar 2014 at 6:07