Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development Technologies
- Intel® ISA Extensions
- Binary operators a%b and a/b in SSE2

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Smart_Lubobya

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-23-2010
08:13 AM

85 Views

Binary operators a%b and a/b in SSE2

int x=k%p; //%modulus operator

int y=a/b; // eg 9/4 is equal to 2 and not 2.25 ?

Link Copied

1 Reply

neni

New Contributor II

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-23-2010
03:11 PM

85 Views

if the numbers are known to have limitedabs value(<2^24), you can convert to float and back to get the div result. mod can be derived from the div result using mul and sub (if you have negative numbers this can be trickier).

if you don't have range limits on the in (assuming 32 bit ints), you need to upconvert to values to doublesand than do 2 doubledivides

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.