Something Better then MOD? 
Author Message
 Something Better then MOD?

Could some one help me with a little math problem.  I need to obtain the
exact remainder of a double value divided by another double value.  The MOD
function is not accurate enough for what I am doing.  My first thoughts was
to use the decimal point from the result with some kind of instr command to
determine where my new value is.

Thanks,

Joel



Tue, 11 Oct 2005 22:29:38 GMT  
 Something Better then MOD?

Quote:

> Could some one help me with a little math problem.  I need to obtain the
> exact remainder of a double value divided by another double value.

"Remainder" doesn't have much meaning in that case, but if you mean the
fractional part, just do x - floor(x) (where x is n/d).

Cheers,
- Joe

,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Wed, 12 Oct 2005 00:26:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MOD and /MOD with Pygmy Forth

2. SM/REM FM/MOD and UM/MOD on a 32bit cell ix86 Forth

3. Utils.Mod, ET.Mod

4. Mod-2 or Mod-3 for Mac

5. Mod-2 and Mod-3 compiler

6. Mod-2 and Mod-3 compiler for the IBM PC and compatibles

7. search algorithm for a math mod function (5 mod[2]=1)

8. OO, C++, and something much better!

9. There has to be something better than R&R report writer for DOS

10. Something better than Lex and Yacc?

11. OO, C++, and something much better!

12. Good code examples: Lisp needs something like this:

 

 
Powered by phpBB® Forum Software