MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / round

Method round

vm/JavaAPI/src/java/lang/Math.java:174–180  ·  view source on GitHub ↗

Returns the result of rounding the argument to an integer. The result is equivalent to (long) Math.floor(d+0.5). Special cases: round(+0.0) = +0.0 round(-0.0) = +0.0 round((anything > Long.MAX_VALUE) = Long.MAX_VALUE {@code roun

(double d)

Source from the content-addressed store, hash-verified

172 * @return the closest integer to the argument.
173 */
174 public static long round(double d) {
175 // check for NaN
176 if (d != d) {
177 return 0L;
178 }
179 return (long) floor(d + 0.5d);
180 }
181
182 /**
183 * Returns the result of rounding the argument to an integer. The result is

Callers 15

downSampleMethod · 0.95
writeAudioMethod · 0.95
applyVolumeMethod · 0.95
paintMethod · 0.95
paintMethod · 0.95
getCroppedImageMethod · 0.95
paintMethod · 0.95
createPeerMethod · 0.95
rasterTileSizeMethod · 0.95
drawLabelsMethod · 0.95

Calls 1

floorMethod · 0.95

Tested by 15

percentLabelMethod · 0.76
timeForProgressMethod · 0.76
renderFrameMethod · 0.76
buildBadgeMethod · 0.76
formatDecimalMethod · 0.76
renderFrameMethod · 0.76
runRoundTripMethod · 0.76
encodeThenDecodeMethod · 0.76
paintMethod · 0.76
buildScreenshotMethod · 0.76
drawContentMethod · 0.76
shotMethod · 0.76