Slimelite BBS

Support Group

Back to EMULATE

From Brian Wisti · 1996-04-05 16:01 · #73536 in EMULATE

-> BW> This is definitely not something that's been covered in the
-> books I'm reading. May even be useful for me! Just for
-> discipline's sake, I have been reviewing my math and making my
-> own functions etcetera for different math operations.
->
-> Really? I've been thinking of doing the same thing. I'm thinking of
-> writing a C++ math library. I hope to give it the ability to
-> rearrange
-> equasions to solve for any one variable, do implicit differentiation,
-> handle matrix and vector math. Not like I'll ever finish it <grin>, b
-> should be fun to write.        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 Sounds all too familiar, but at least it is fun. We're sick.
-> Well, if you're interested, I have some math types I could crosspost
-> here. I have a vector template, a fixed point real number class, and
-> I'm working on a real number class which can handle the integer
-> operations %, %=, <<, >>, <<=,and >>=. What math classes are you
-> writing in particular?

It was only about a week ago that I first dug into my own data types for
tasks like math-related options, and it was for a specific project of
mine : a World-generating system for the role-playing game Traveller (ya
know, I've never actually played it, but it's been my pet for
programming ever since Applesoft BASIC). The game uses a
pseudo-hexadecimal notation system : 0-9, A-Z.

After fiddling around with some pretty clunky functions, it occured to
me that it could be a class, roughly as follows:

class Rating
{
 private :
  int value; //numeric value of Rating
  char score;//displayed value of Rating
  void setScore();//allow for change in Rating's state without forcing
               //temporary objects onto the scene
  void setVal();//Put this one in for the sheer joy of it

 public :
  Rating();
  Rating(char);
  Rating(int);
  ~Rating();
  Rating operator+(int&);
  Rating operator-(int&);
  int operator<(int&);
  int operator>(int&);
  int operator==(int&);
  char Score();// sends score value to interested functions
};

I won't go into any further details, mainly because it just occured to
me that I'm rambling. But that, to answer your question, is my math
library at this moment. Although I appreciate your offer of crossposting
some additional code, the math _skills_ are essential first. It's been
about 6 years since high school for me, and I wasn't too intent on
classwork back then. Just the little bit of brushing up I've done this
last week(inspired by my cute little Rating class) has shown me a few
alternate methods of solving numerous prblems in my style.
Of course, somebody out there's bound to be interested, so go right
ahead!And please forgive my babblings - I'm only halfway through my
first cup of coffee :)

--- WILDMAIL!/WC v4.12 
 * Origin: R-Squared BBS, Oly WA USA, 33k6bps, 360-705-4475  (1:352/28.0)