forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

problem with lrintf()

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
jockyw2001



Joined: 29 Sep 2005
Posts: 339

PostPosted: Sun Sep 03, 2006 7:35 pm    Post subject: problem with lrintf() Reply with quote

I get an exception with lrintf(float f) if for example f=2264386731.980626
I tried to use llintf(double d), but that functions isn't present.

Is there perhaps a bug in the lrintf implementation?
(I saw this: http://www.cygwin.com/ml/cygwin/2005-09/msg00252.html)
What are actually the limits for f?
Does anyone know what alternative rounding function I can use?

Thx!

UPDATE: pls ignore my questions found the solution already, I must use lrint(double d)
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Fri Sep 08, 2006 6:34 pm    Post subject: Reply with quote

doubles on psp are a no no :P
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
jockyw2001



Joined: 29 Sep 2005
Posts: 339

PostPosted: Fri Sep 08, 2006 9:59 pm    Post subject: Reply with quote

Hmm, then please explain me why lrintf raises an exception and lrint works just fine?
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Fri Sep 08, 2006 10:11 pm    Post subject: Reply with quote

Probably because doubles are emulated by the compiler and won't trigger the same exception as the hardware float support does. Using software doubles cost a lot of performance however, so if this function is called often you will see performance degradation.
_________________
GE Dominator
Back to top
View user's profile Send private message
jockyw2001



Joined: 29 Sep 2005
Posts: 339

PostPosted: Fri Sep 08, 2006 10:20 pm    Post subject: Reply with quote

Okay, thanks for the insights guys
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group