From b8538a78b92ee4ba089dbb1295189df35baf6464 Mon Sep 17 00:00:00 2001 From: AliceMadama Date: Tue, 21 May 2024 10:30:23 +0200 Subject: [PATCH] changed to everything we do not account for is 32 --- RevolveUavcan/Tools/BitArrayTools.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/RevolveUavcan/Tools/BitArrayTools.cs b/RevolveUavcan/Tools/BitArrayTools.cs index 6fe6cb7..323d77e 100644 --- a/RevolveUavcan/Tools/BitArrayTools.cs +++ b/RevolveUavcan/Tools/BitArrayTools.cs @@ -234,10 +234,7 @@ public static BitArray GetBitArrayFromDouble(double value, int size) if (size == 64) { bytes = BitConverter.GetBytes(value); - } - else if (size == 32) - { - bytes = BitConverter.GetBytes((float)value); + } else if (size == 16) { @@ -245,7 +242,7 @@ public static BitArray GetBitArrayFromDouble(double value, int size) } else { - throw new ArgumentException("Unsupported bit length; must be 16, 32, or 64 bits."); + bytes = BitConverter.GetBytes((float)value); } if (!BitConverter.IsLittleEndian)