March 2019
Intermediate to advanced
336 pages
9h 9m
English
The fraction class has the numerator and denominator integer properties. The String method of the fraction class, as shown in the following snippet, returns a string version of fraction:
// string method of fraction classfunc (frac fraction) String() string { return fmt.Sprintf("%d/%d", frac.numerator, frac.denominator)}
Read now
Unlock full access