Here you can find the source of fractionalPart(float fnum)
static float fractionalPart(float fnum)
//package com.java2s; /* Copyright (c) 2016//from w w w . j av a2 s .co m * by Bj?nd, Inc., Boston, MA * * This software is furnished under a license and may be used only in * accordance with the terms of such license. This software may not be * provided or otherwise made available to any other party. No title to * nor ownership of the software is hereby transferred. * * This software is the intellectual property of Bj?nd, Inc., * and is protected by the copyright laws of the United States of America. * All rights reserved internationally. * */ public class Main { static float fractionalPart(float fnum) { int wholePart = wholePart(fnum); return fnum - wholePart; } static int wholePart(float num) { return (int) num; } }