Jump to content

Recommended Posts

I am using version 6.97

I have some division operations in my code

Is there a requirement that both numerator and denominator be of the same type or is it possible to divide a certain type by a shorter type, say, a long by int (I assume the result will be presented as long).

Obviously I do not intend to divide a any type by a longer type

Link to post
Share on other sites

Hi,

 

The compiler will decide which is the best division to use for the job.

 

If you are dividing a long by an int then the largest type will be used (long). It will also return a long.

 

Cheers

 

Reynard

Link to post
Share on other sites

Thanks,

 

Looked a bit into the memory code and noticed that two division functions are created: div_32_32 and div_16_16

So I assume that the compiler selects the correct function according to the longest variable and if required casts the shorter one into a longer one

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...