CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

the math modulus: efficient implementation suggs.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








the math modulus: efficient implementation suggs.
PostPosted: Thu Oct 06, 2005 12:27 am     Reply with quote

hi guyz,

remember in hi school math, we wd use a modulus function to ignore the negative sign. e.g 81- 100 = -19, and mod of (-19) would simply make it +19. this function has not been implemented here but can easily be tackled in code. Whats in ur opinion the most efficient way to go about it?
Ttelmah
Guest







PostPosted: Thu Oct 06, 2005 2:40 am     Reply with quote

A 'modulus', does not ignore the negative sign. You are mis-remembering your maths. A modulus function, splits a real number, into it's integral, and fractional parts, and is implemented as the 'MODF' function. The mathematical term for the scale of a number (ignoring it's sign), is the 'absolute value', and this is implemented as the 'ABS' function.

Best Wishes
Guest








PostPosted: Thu Oct 06, 2005 11:10 pm     Reply with quote

Thanx ! i forgot the name 'absolute'. Im familiar with modulus Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 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