Float array To Short array - CSharp System

CSharp examples for System:Array Element

Description

Float array To Short array

Demo Code


using System;// ww  w.j a va 2  s. com

public class Main{
        public static void FloatToShort(float[] input,int count,short[] output)
        {
            for (var i = 0; i < count; ++i )
            {
                output[i] = (short)(input[i] * (float)short.MaxValue);
            }
        }
}

Related Tutorials