In case anyone needs to convert a single precision float to a double precision float here is a subroutine for that:

Passed parameters:

fInput float

nnOutput int64

```
Move32Bits(fInput, nInputInt);
// pull out the sign bit (and first bit of the exponent)
nSignBits = nInputInt bitAND 0xC0000000;
// move the rest of the bits to an int64 for manipulation
nnValue = MakeInt64(nInputInt, 0);
// right shift 3, but pad with the the second most significant bit of the exponent instead of 0's
// this will correctly account for the different exponent bias values of 127 and 1023
nnValue = (nnValue << 2) / 32;
// put the sign bit back in
nOutputLow = GetLowBitsOfInt64(nnValue);
nOutputHigh = (GetHighBitsOfInt64(nnValue) bitAND 0x3FFFFFFF) bitOR nSignBits;
// assemble the output
nnOutput = MakeInt64(nOutputHigh, nOutputLow);
```

This seems to work for all valid 32 bit floats, however you should note that it may fill sudo-random digits beyond the precision of the original value instead of filling with 0’s.

For example:

fInput = 1.1000000

nnOutput = 1.1000000238418580

All (smallish) integer input values should still convert exactly:

fInput = 1.0000000

nnOutput = 1.0000000000000000

Obviously the output here is stored in a 64 bit integer variable, since there is no 64 float type in Opto.