There are a few standard ways of writing ratios that aren't parsed properly.
Using a colon 3:2
Using an 'x' 3x2
others?
Ratio("3:2"); and Ratio("3x2"); should parse into a ratio just as Ratio("3/2"); does.
When parsed using an alternative divSign, that divSign should be set on the instantiated Ratio object.
When a Ratio has a divSign that is not a forward slash '/', the Ratio's divSign should be preserved through methods that create new Ratio objects (any method that uses .clone() internally).
There are a few standard ways of writing ratios that aren't parsed properly. Using a colon
3:2
Using an 'x'3x2
others?Ratio("3:2");
andRatio("3x2");
should parse into a ratio just asRatio("3/2");
does.When parsed using an alternative divSign, that divSign should be set on the instantiated Ratio object.
When a Ratio has a divSign that is not a forward slash '/', the Ratio's divSign should be preserved through methods that create new Ratio objects (any method that uses
.clone()
internally).