Here you can find the source of toFloat(double[] a)
Parameter | Description |
---|---|
a | a parameter |
public static float[] toFloat(double[] a)
//package com.java2s; /*----------------------------------------------------------------------------- * GDSC SMLM Software//from w w w . j a v a 2 s . com * * Copyright (C) 2016 Alex Herbert * Genome Damage and Stability Centre * University of Sussex, UK * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. *---------------------------------------------------------------------------*/ public class Main { /** * Convert the input array to a float * * @param a * @return The new array */ public static float[] toFloat(double[] a) { if (a == null) return null; float[] b = new float[a.length]; for (int i = 0; i < a.length; i++) b[i] = (float) a[i]; return b; } }