Path: chuka.playstation.co.uk!chuka.playstation.co.uk!chuka.playstation.co.uk!not-for-mail From: Lewis_Evans@Playstation.sony.com Newsgroups: scee.yaroze.beginners Subject: I can'tuse math functions!!!! Date: 25 Feb 1998 10:11:26 -0000 Organization: Sony Computer Entertainment Europe - 119.SS5 Lines: 50 Sender: news@chuka.playstation.co.uk Message-ID: <6d0qoe$ac81@emeka.playstation.co.uk> Reply-To: Lewis_Evans@Playstation.sony.com NNTP-Posting-Host: emeka.playstation.co.uk From: Lewis_Evans@Playstation.sony.com To: news@playstation.co.uk Note that floating-point is not very fast. You may be better off doing 'fractional fixed point'. eg using a 32-bit int as u_short integer part (top 16 bits) and 0-4095 fractional part (lower 16 bits) eg // second arg must be 0 to 4095 int MakeComposite (int integerPart, int fractionalPart) { return( (integerPart << 16) + fractionalPart); } void DecomposeComposite (int composite, int *integerPart, int *fractionalPart) { *integerPart = composite >> 16; *fractionalPart = composite & 0xffff; } This way, you get the fractional functionality of float, running faster, and no undefined conversion problems. Lewis To: Lewis Evans cc: From: news @ playstation.co.uk Subject: I can'tuse math functions!!!!:scee.yaroze.beginners From: "Emanuele Diotallevi" Newsgroups: scee.yaroze.beginners Subject: I can'tuse math functions!!!! Why with codewarrior i can't use math function ???? The Linker says every time that are not defined convertion functions FloatingPoint<----->no Floating Point types!!!! If there's someone that have some sqrt or e^x function tables please help me!! Diotallevi Emanuele