[erlang-questions] Float to binary

Richard O'Keefe ok@REDACTED
Tue Mar 22 02:24:14 CET 2011


On 22/03/2011, at 11:27 AM, Bob Cowdery wrote:

> Its part of a binary that gets sent to a device. Its not actually a
> scaling factor its simply a conversion from MHZ to Hz. 1 MHz =
> 1000000Hz.

Er, that _is_ a scaling factor.

> The frequency internally is a float but needs to be a 32 bit
> big-endian number in Hz to send to the device.

So will   Hz = round(1000000 * MHz)  do?



More information about the erlang-questions mailing list