I am trying to use a COM component on Windows in Ruby which expects numbers in single precision.
In C# I am able to cast a number from double to single precision like this.
float mynumber = (float)2.0
How can I create a single precision floating point number in Ruby?
Ruby itself does not support single precision floats.
You can use the gem float-formats for doing calculations/conversion in different float formats.
But for handing an object created by this gem to a COM object you will have to convert it to the expected memory representation somehow.