  @Test
  public void testScale() {

    float[] da = {1, -1, 3.1f, 0.0f, 0};
    Assert.assertTrue(inDelta(FloatArrays.scale(da, 0), new float[]{0, 0, 0, 0, 0}));
    Assert.assertTrue(inDelta(FloatArrays.scale(da, -1), new float[]{-1, 1, -3.1f, 0, 0.0f}));
    Assert.assertTrue(inDelta(FloatArrays.scale(da, 4), new float[]{4, -4, 12.4f, 0.0f, 0.0f}));

    FloatArrays.scaleInPlace(da, 4);
    Assert.assertTrue(inDelta(da, new float[]{4, -4, 12.4f, 0.0f, 0.0f}));
    FloatArrays.scaleInPlace(da, 0);
    Assert.assertTrue(inDelta(da, new float[]{0, 0, 0, 0, 0}));
  }