Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fast way to get the sign of a floating point number?



The SETcc family of instructions will set the AL register to 0 or 1 depending on the current condition flags. Combined with a suitable comparison instruction, this will return a boolean. A good compiler will do this for you, though, with this function:

inline bool isSigned(float f) { return f < 0.0f; }

Best regards,
Frederik Slijkerman

----- Original Message ----- From: <email@hidden>
To: <email@hidden>
Sent: Tuesday, November 29, 2005 22:48
Subject: Re: Fast way to get the sign of a floating point number?



Is there an equivalent instruction to fsel on Intel machines?

thanks
Jeff

>Err... wouldn't it need to be sign = __fsel( v, -1.0, 1.0 )?

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Fast way to get the sign of a floating point number? (From: email@hidden)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.