Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

? Floating Point Modulus - How to ?

Status
Not open for further replies.

astrogirl77

Programmer
Aug 14, 2008
45
CA

Hi,

I'm trying to figure out how to create a simple floating point modulus function for VB.

Im using an OLD VB version, version 4.0. Yikes, yes I know I should upgrade and will... but am working currently on some old code and not ready yet to move up.

I can't use the standard default Mod operator for what I'd like to do since it rounds all the values.

I'd like to be able to perform operations on numbers as large as the max ceiling of ;

"Currency (scaled integer) 8 bytes -922,337,203,685,477.5808 to 922,337,203,685,477.5807."

Or as large as possible, but I'd like to get a mod value back thats a floating point and accurate past the decimal point (no rounding and little to no truncating) or at least as close, accurate as possible.

I've scoured the internet for solutions, (and no this is NOT a schoolo or class assingment - I'm working on a purely personal project) and so far have come up blank. I have found some solutions that look workable in C, but I can't program in C currently. I also found the basic math equations for the INT variants... but these won't work as Im hoping in code... at least I haven't been able to get it to.

If anyone could provide some feedback, suggestions, support, references, code snippets.... I'd really appreciate it.

Thanks and best to all!

AstroGurl

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top