Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wbhob/log-base-n
A utility for finding a logarithm with any base
https://github.com/wbhob/log-base-n
Last synced: 8 days ago
JSON representation
A utility for finding a logarithm with any base
- Host: GitHub
- URL: https://github.com/wbhob/log-base-n
- Owner: wbhob
- License: mit
- Created: 2019-04-24T18:46:24.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-24T19:34:09.000Z (almost 6 years ago)
- Last Synced: 2024-12-01T13:48:57.174Z (2 months ago)
- Language: TypeScript
- Size: 161 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# log-b
Find the logarithm of any number with any base in code or with the command line.
This project uses the division property of logarithms to determine the logarithm with any base. Read more [here](https://people.richland.edu/james/lecture/m116/logs/properties.html).
## Usage
```typescript
import logBase from 'log-base-n'logBase(2, 8) // returns 3
```### ES5 Usage
```javascript
var logBase = require('log-base-n').default // this is because it is an ES6 default exportlogBase(2, 8) // returns 3
```## Contributing
If you want to contribute, implement it in TypeScript in the `src/` directory. Add a test file in `__tests__/` to make sure it works properly – you can just copy one of the other testing files and substitute in your sorting algorithm.
## License
This project is licensed under the [MIT License](./LICENSE), so you're free to use it as you please with attribution and a link back to this project (though writing your own implementation would not be terribly difficult).
## Credits
Written by Wilson Hobbs, 2019.