List of usage examples for android.util Rational getDenominator
public int getDenominator()
The denominator may return 0 , in which case the rational may represent positive infinity (if the numerator was positive), negative infinity (if the numerator was negative), or NaN (if the numerator was 0 ).
The denominator will always return 1 if the numerator is 0 .
From source file:com.android.camera2.its.ItsSerializer.java
@SuppressWarnings("unchecked") private static Object serializeRational(Rational rat) throws org.json.JSONException { JSONObject ratObj = new JSONObject(); ratObj.put("numerator", rat.getNumerator()); ratObj.put("denominator", rat.getDenominator()); return ratObj; }
From source file:com.android.camera2.its.ItsService.java
private static float r2f(Rational r) { return (float) r.getNumerator() / (float) r.getDenominator(); }