I'm not an expert on XC16, but you could try something like f =3D *(_Fract *) &i; Or * (_int *) &f =3D i; This trick often lets you coerce datatypes like you are trying to do. ~ Bob Ammerman RAm Systems -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Edson Brusque Sent: Thursday, July 17, 2014 4:20 PM To: Microcontroller discussion list - Public. Subject: [PIC] Moving an uint16_t to _Fract in XC16 Hello all! I'm stuck in an strange situation. I've read the docs, googled a lot, researched a lot and still haven't solved it. Please, let me explain with an example: ---- uint16_t i; // A 16 bit signed integer _Fract f; // A 16 bit signed fractional i =3D 100; // [i] is now 0x0064 f =3D i; // [f] is now 0x7FFF. I need it to be 0x0064. ---- The actual application is getting values from an external ADC in signe= d int form and needs to move to a _Fract value to make use of fractional arithmetics built in XC16. But the compiler is doing some conversion with saturation. I just need the int values (-32768 to +32767) scalled to fractional (-1 to +1). Actually, it's just copying the contents from one register to the other. I can convert int to float and then make the conversion and scalling t= o _Fract but it's a lot of wasted CPU cycles. Anyone have any clues? Best regards! --=20 Edson Brusque Tim: (47)9938-3439 --------------------------------------------------------------------- Edson Brusque www.BruschiAmps.com.br Blumenau, SC, Brazil (47)3232-0984 --------------------------------------------------------------------- -- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/chang= e your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .