views:

52

answers:

0

I am attempting to typecast some data from int32 to single. I first tried using the 'Data Type Conversion' block with single output data type and the Stored Integer option. However, I found that the datatype conversion block is not typecasting the data the way I expect it to. Am I using the block incorrectly, or is it failing to work as it should?

temp1 (pre conversion):
uint32: 1405695244
single: 1728356810752.000000
binary: 01010011110010010011010100001100

temp2 (post conversion):
uint32: 1319604842
single: 1405695232.000000
binary: 01001110101001111001001001101010

By the way, I have gotten around the issue by using an embedded Matlab block to perform the typecasting operation.

related questions