Thread: Unlimited length floating point calculator

  1. #31
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    It gives incorrect results when raising, for example, pi to the power of pi. It would be better to just display an error message or something.
    And now it seems to answer n % m = 0 if n<m
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  2. #32
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Geez I'm very thankful that you're checking this garbage out for me. Just as before it is a simple thing hardcoded in (if num is < denom on mod) and I was providing the wrong answer.

    That is an excellent recommendation. I will absolutely inform the user of the lack of rational exponents. Thanks again sang-drax. I appreciate it.

  3. #33
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Okay I made those changes I talked about and found another modulus problem (I didn't provide enough precision for the division when trying to calculate the mod) and fixed lots of other small things. It should be very sturdy now (just don't throw any rocks at it or it'll fall down). Thanks again Mr. Drax.

    If you are at all interested in using it or bugtesting it, you can get it from that link in my sig. Thanks all.

  4. #34
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Try dividing 1 with 3.141592. Gives quite different results if the precision is changed from 30 to 10.

    Also, Ctrl+C doesn't work for me (WinXPprofSP2) Ctrl+X erases window but doesn't add anything to the clipboard.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  5. #35
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    I've made one more change regarding precision. I was taking into account the integer part of the number and doing some other things that cause me to miscalculate, but it is much better now. If you still have any difficulties in computation please let me know.

    Hmm... The clipboard thing sounds very strange. I ran this on my other computer (also WinXP pro SP2) and didn't have any difficulties. I added a message on clipboard failure. If you give it a try and it still fails, please let me know what it says. On this (Win98) it works seamlessly.

    Again, there is another version (1.02) at that link (here).

  6. #36
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Hmm... no error message -- it just doesn't work.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  7. #37
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Okay sang-drax, I've got you cornered. The clipboard operations are working perfectly now and I discovered a problem that you didn't.
    I tried 1/Pi to see how accurate it was to the 1/Pi button's value and only the first few digits were correct. After several hours of painstaking work I finally discovered I wasn't borrowing properly in my subtraction and that screwed up my division. Now I can confidently say that every operation is calculated flawlessly.

    Seriously, thanks a whole lot.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. floating point number comparison
    By lehe in forum C++ Programming
    Replies: 10
    Last Post: 05-18-2009, 07:11 PM
  2. checking for floating point number
    By ssharish2005 in forum C Programming
    Replies: 6
    Last Post: 10-18-2005, 08:14 PM
  3. Floating point exceptions
    By Boris in forum C++ Programming
    Replies: 8
    Last Post: 11-19-2001, 08:32 AM
  4. Floating point faster than fixed-point
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 11-08-2001, 11:34 PM
  5. Replies: 2
    Last Post: 09-10-2001, 12:00 PM