Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BDouble String Initializer and Optionals #20

Merged
merged 2 commits into from
Dec 20, 2017
Merged

Conversation

twodayslate
Copy link
Collaborator

@twodayslate twodayslate commented Dec 20, 2017

A better String initializer for BDouble for #19. I just used the initializer for a Double since that was already parsed using its' String representation.

>>> BDouble("no")
nil
>>> BDouble("123")
Optional(123)
>>> BDouble("1.2e10")
Optional(120000000000)
>>> BDouble("1.2")
Optional(6/5)

I removed the Fatal Error thrown when constructing an BInt and instead use optionals. I have updated the README to reflect this

I also added more descriptions

>>> var bd2 = BDouble("123453434.2341313123123131123123")!
1234534342341313123123131123123/10000000000000000000000
>>> bd2.fractionDescription
1234534342341313123123131123123/10000000000000000000000
>>> bd2.decimalDescription
123453434.2341
>>> bd2.precision = 10
>>> bd2.decimalDescription
123453434.2341313123
>>> bs2.precision = 2
>>> bd2.decimalDescription
123453434.23

Can we break up SMP.swift? I love the idea of a single file for usage but my Mac isn't handling it's huge size so well. It won't even show the diff by default on Github

FYSA, you can squash all my commits into one commit to make the repository look cleaner.

Looking forward to your thoughts. Thanks

@mkrd
Copy link
Owner

mkrd commented Dec 20, 2017

Looks good to me. I like the examples that you used here, they should also be in the readme 👍
I'll think about splitting the file up, but I prefer it like this. It's really great for people who just want to get the library without much hassle, just dragging one file into their project.

@mkrd mkrd merged commit 5d876ee into mkrd:master Dec 20, 2017
@twodayslate twodayslate mentioned this pull request Dec 24, 2017
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants