Here you can find the source of divide(final float dividend, final float divisor)
Parameter | Description |
---|---|
dividend | Dividend |
divisor | Divisor |
public static float divide(final float dividend, final float divisor)
//package com.java2s; /*L//from w w w.j a v a 2s.c o m * Copyright RTI International * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/webgenome/LICENSE.txt for details. */ public class Main { /** * Division that is tolerant of NaN. NaN / x = NaN and x / NaN = NaN. * @param dividend Dividend * @param divisor Divisor * @return A value */ public static float divide(final float dividend, final float divisor) { float value = Float.NaN; if (!Float.isNaN(dividend) && !Float.isNaN(divisor)) { value = dividend / divisor; } return value; } }