#68: Subtraction Error

View: New views
2 Messages — Rating Filter:   Alert me  

#68: Subtraction Error

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#68: Subtraction Error
-----------------------------------+----------------------------------------
 Reporter:  neumarcx               |       Owner:  nobody
     Type:  defect                 |      Status:  new  
 Priority:  major                  |   Milestone:        
Component:  hugs                   |     Version:  200609
 Keywords:  arithmetic operations  |  
-----------------------------------+----------------------------------------
Why is the difference between minuend and subtrahend wrong, if you use any
 5 digit exponent for floating point numbers ?

 e.g.

 Version: Sep 2006
 Haskell 98 mode: Restart with command line option -98 to enable extensions

 Type :? for help
 Hugs> 12345 - 12345.1
 -0.100000000000364

--
Ticket URL: <http://hackage.haskell.org/trac/hugs/ticket/68>
Hugs <http://www.haskell.org/hugs/>
Hugs 98, an interpreter for Haskell
_______________________________________________
Hugs-Bugs mailing list
Hugs-Bugs@...
http://www.haskell.org/mailman/listinfo/hugs-bugs

Re: #68: Subtraction Error

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#68: Subtraction Error
-----------------------+----------------------------------------------------
  Reporter:  neumarcx  |       Owner:  nobody              
      Type:  defect    |      Status:  closed              
  Priority:  major     |   Milestone:                      
 Component:  hugs      |     Version:  200609              
Resolution:  invalid   |    Keywords:  arithmetic operations
-----------------------+----------------------------------------------------
Changes (by ross):

  * resolution:  => invalid
  * status:  new => closed

Comment:

 This is normal behaviour for floating point types in any language: being
 fixed size binary formats, they can represent decimal fractions only
 approximately.  For operations on exact fractions, Haskell provides
 `Rational`.

--
Ticket URL: <http://hackage.haskell.org/trac/hugs/ticket/68>
Hugs <http://www.haskell.org/hugs/>
Hugs 98, an interpreter for Haskell
_______________________________________________
Hugs-Bugs mailing list
Hugs-Bugs@...
http://www.haskell.org/mailman/listinfo/hugs-bugs
LightInTheBox - Buy quality products at wholesale price!