Bug 5252 - Arithmetic of float variable and Integer value fails (on hpd)
Summary: Arithmetic of float variable and Integer value fails (on hpd)
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-02 15:45 UTC by Teresa Thomas
Modified: 2008-01-24 19:34 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Teresa Thomas 2007-11-02 15:45:39 UTC
(fhpd) print float_ 
[0.0]

4.0
(fhpd) print float_ + 1 
[0.0]

0.0
Comment 1 Teresa Thomas 2007-11-15 20:13:14 UTC
Prints by C test program on i686 - uses sizeof operator:
sizeof float_: 4
sizeof long_: 4
sizeof (long_ + float_): 4

GDB outputs:
(gdb) print sizeof long_
$1 = 4
(gdb) print sizeof float_
$2 = 4
(gdb) print sizeof (long_ + float_)
$3 = 8  [NOTE!]
Comment 2 Teresa Thomas 2008-01-24 19:34:08 UTC
    Use BigFloatingPoint for arithmetic operations.
    
    frysk-core/frysk/value/ChangeLog
    2008-01-23  Teresa Thomas  <tthomas@redhat.com>
    
    	* BigFloatingPoint.java: Add arithmetic functions.
    	* FloatingPointUnit.java: Use BigFloatingPoint for
    	arithmetics.
    	* Value.java (asBigFloatingPoint): Fix cast.
    	* IntegerType.java (putBigFloatingPoint): New.
    	* FloatingPointType.java (putBigFloatingPoint): New.
    	* ArithmeticType.java (putBigFloatingPoint): New.