Skip to content

Commit

Permalink
changed to everything we do not account for is 32
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceMadama committed May 21, 2024
1 parent b5adac4 commit b8538a7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions RevolveUavcan/Tools/BitArrayTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,15 @@ 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)
{
bytes = BitConverter.GetBytes((Half)value);
}
else
{
throw new ArgumentException("Unsupported bit length; must be 16, 32, or 64 bits.");
bytes = BitConverter.GetBytes((float)value);
}

if (!BitConverter.IsLittleEndian)
Expand Down

0 comments on commit b8538a7

Please sign in to comment.