problem with lrintf()

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

problem with lrintf()

Post by jockyw2001 »

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)
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

doubles on psp are a no no :P
10011011 00101010 11010111 10001001 10111010
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

Hmm, then please explain me why lrintf raises an exception and lrint works just fine?
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

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
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

Okay, thanks for the insights guys
Post Reply