System: Windows XP sp2
Compiler: arm-nds-fpc 2.1.4. i386-win32
API: none
I need to do some conversion from floating point values to 1.19.12 fixed point. The code I have found in C is:
Code:
#define floattof32(n) ((int32)((n) * (1 << 12)))
that I have tried to convert in this way:
[pascal]function floattof32(n: cfloat): cint32; inline;
begin
floattof32 := (cint32(n) * (1 shl 12));
end;[/pascal]
but does not work as I expected. Can anyone help me here?
Bookmarks