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

Implement Interfaces #1

Closed
vbjay opened this issue Apr 24, 2016 · 4 comments
Closed

Implement Interfaces #1

vbjay opened this issue Apr 24, 2016 · 4 comments

Comments

@vbjay
Copy link

vbjay commented Apr 24, 2016

Make fraction inherit from https://msdn.microsoft.com/en-us/library/system.valuetype(v=vs.110).aspx ValueType.

Get rid of shadows and override ToString.

@ZdsAlpha
Copy link
Owner

But it is structure not a class.

@vbjay
Copy link
Author

vbjay commented Apr 24, 2016

Ok. In that case you might want to look at implementing
IComparable, IFormattable, IConvertible
, IComparable(of Fraction), IEquatable(of Fraction)

@vbjay vbjay changed the title Inherit from ValueType Implement Interfaces Apr 24, 2016
@ZdsAlpha
Copy link
Owner

Some conversions are not possible e.g conversion to char or DateTime.
Also GetTypeCode cannot be implemented because it is none of pre-defined types.

@ZdsAlpha
Copy link
Owner

Implemented over IComparable, IComparable(Of Fraction), IEquatable(Of Fraction).

@vbjay vbjay closed this as completed Apr 24, 2016
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

No branches or pull requests

2 participants