Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: jamin1@psu.edu (Jamin Frederick) Newsgroups: scee.yaroze.programming.codewarrior Subject: Re: float and integer trouble Date: Tue, 30 Jun 1998 22:46:24 GMT Organization: SCEA News Server Lines: 43 Message-ID: <35996a7d.371661938@news.scea.sony.com> References: <358043B8.19F1@cs.bham.ac.uk> <35806BF5.1479FC36@compuserve.com> NNTP-Posting-Host: 204.240.38.127 X-Newsreader: Forte Free Agent 1.11/32.235 Does anyone know what kind of stuff the compiler has to generate to make floating point work on the playstation? It seems like it would clog things up if it was used too much. Jamin On Fri, 12 Jun 1998 00:44:53 +0100, Nick Slaven wrote: >Steve Randerson wrote: >> >> I seem to be having a bit of trouble with integers and floats. I'm a >> Java programmer normally and don't have much experience with C so it may >> be me being crap but anyway. whenever I try any arithmetic involving a >> float and an integer i get errors from codearrior. it compiles fine but >> has a linker error saying it can't find _f_ftoi. >> I presume it is legal to add a float aand an int otherwise it would >> have a compiler error. I've tried searching all the header files to see >> if I can find ftoi but i can't. >> If anyone has any suggestions, or what i'm trying is just not possible >> then any help would be much appreciated. >> >> cheers steve > >Sounds like a library problem to me, have you specified all the libs >you need? I think there is an extra maths lib you have to link in if >you want to use floating point arithmatic. (ftoi will be a "float to int" >function call generated by the compiler & the only place it will be defined >is inside a library) >& yes its perfectly legal in C to mix all the variable types you like in >calculations (including pointers!). > > >Cheers > > >Nick > >-- > >http://www.netyaroze-europe.com/~nslaven/