Skip to content

Commit e538465

Browse files
committed
Ready for release.
0 parents  commit e538465

36 files changed

+7718
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Namespace name
16+
2. Function name
17+
3. Param type(s), 'If more than one value, please separate the values by a comma'.
18+
4. Param's value(s). 'If more than one value, please put the values inside quotes and separate them by a comma'.
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Runtime**
27+
- OS: [e.g. Windows 10]
28+
- Environment: [e.g. Browser, Nodejs v8.10.0]
29+
- Browser [e.g. Mozilla Firefox 65.0]
30+
31+
**Additional context**
32+
Add any other context about the problem here.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Describe a name that may be used as a function name for the feature that you requested.**
20+
A none offensive name that may be used as the function name for the feature that you requested.
21+
22+
**Additional context**
23+
Add any other context about the feature request here.

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at kevin@fai.host. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Khang Hoang Nguyen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# faiNumber-JS
2+
3+
faiNumber-JS is a numerical library for Javascript.
4+
5+
faiNumber-JS mainly deals with converting strings of number to number
6+
type and numerically comparing strings.
7+
8+
This library is a safe library and will only parse values for strings
9+
within the range of `Number.MIN_SAFE_INTEGER` and `Number.MAX_SAFE_INTEGER`
10+
(The safe range). For strings with values that outside of "the safe range",
11+
this library will return undefined when parsing them to values of type
12+
number.
13+
14+
Currently, faiNumber-JS supports converting numerical strings
15+
of radix 2, 3, 8, 10, 16 to values of type number.
16+
17+
When it come to comparing integer strings beyond the safe range, this
18+
library supports comparing strings of any length(bound by memory
19+
limitation) of integer values of any radix between 2 to 36 without
20+
needing to convert them to type number values.
21+
22+
faiNumber-JS library does support nodeJS and can be imported as modules
23+
into nodeJS projects.
24+
25+
One of faiNumber-JS goals is to be able to provide support for all
26+
numbering systems between 2 and 36. Future support for float is also
27+
another goal of this library.
28+
29+
This library does not have any dependency and will maintain that way as
30+
that is also one of this library goal.
31+
32+
This library does not remove any API that was released in any final
33+
build versions without a notice spanning 3 major release versions.
34+
35+
Before using some of the methods of this library, it is recommended to
36+
read the documentation for what they do before using them as some of the
37+
methods of this library were built for expert usage. The previous is
38+
especially true for any assume**** methods that provide by this library.
39+
40+
## Benchmark
41+
<a href="https://github.com/kevinhng86/faiNumber-JS/blob/master/benchmark.md">Benchmark</a>
42+
43+
## Help
44+
<a href="https://lib.fai.host/js/faiNumber/v1/">faiNumber's API Documentation</a>
45+
46+
## License
47+
<a href="https://github.com/kevinhng86/faiNumber-JS/blob/master/LICENSE">MIT</a>

benchmark.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Benchmark
2+
3+
How fast is faiNumber?
4+
5+
The below are benchmark results for Base10Util.toNumber() of faiNumber
6+
(v1.0.0.f) comparing to parseInt() and auto-cast. The benchmark test was
7+
executed on 3 different browsers and also on NodeJS. Each test ran 3
8+
times and the average result from all 3 runs is used as the result.
9+
Results are in milliseconds and were rounded to the nearest value of 2
10+
decimal placement. For the result, the lower is the better.
11+
12+
###### CPU: AMD® A10-7800 radeon r7, 12 compute cores 4c+8g × 4
13+
###### OS: Ubuntu 18.04.1 LTS
14+
<br>
15+
16+
##### Base10Util(Chrome 71.0.3578.98)
17+
##### Parsed 500000 Strings
18+
| | Length 1 | Length 10 | Length 16 |
19+
|---|---|---|---|
20+
| parseInt() | 14.67ms | 91.33ms | 241.33ms |
21+
| toNumber() | 24.00ms | 53.00ms | 193.67ms |
22+
| Auto-cast | 15.67ms | 101.33ms | 248.33ms |
23+
24+
##### Base10Util(Mozilla Firefox 65.0)
25+
##### Parsed 500000 Strings
26+
| | Length 1 | Length 10 | Length 16
27+
|---|---|---|---|
28+
| parseInt() | 14.00ms | 52.00ms | 65.33ms |
29+
| toNumber() | 16.67ms | 51.33ms | 46.00ms |
30+
| Auto-cast | 40.00ms | 89.33ms | 178.00ms |
31+
32+
##### Base10Util(Opera 58.0.3135.65)
33+
##### Parsed 500000 Strings
34+
| | Length 1 | Length 10 | Length 16
35+
|---|---|---|---|
36+
| parseInt() | 15.00ms | 93.67ms | 247.33ms |
37+
| toNumber() | 26.00ms | 59.00ms | 258.33ms |
38+
| Auto-cast | 17.00ms | 106.33ms | 253.67ms |
39+
40+
##### Base10Util(NodeJS v8.10.0)
41+
##### Parsed 500000 Strings
42+
| | Length 1 | Length 10 | Length 16
43+
|---|---|---|---|
44+
| parseInt() | 13.00ms | 74.33ms | 179.67ms |
45+
| toNumber() | 22.67ms | 71.67ms | 257.33ms |
46+
| Auto-cast | 12.33ms | 81.33ms | 229.33ms |

0 commit comments

Comments
 (0)