Subversion Repositories HelenOS-historic

Rev

Rev 834 | Rev 1657 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 834 Rev 1031
Line 33... Line 33...
33
/** Add two Float32 numbers with same signs
33
/** Add two Float32 numbers with same signs
34
 */
34
 */
35
float32 addFloat32(float32 a, float32 b)
35
float32 addFloat32(float32 a, float32 b)
36
{
36
{
37
    int expdiff;
37
    int expdiff;
38
    __u32 exp1, exp2,frac1, frac2;
38
    uint32_t exp1, exp2,frac1, frac2;
39
   
39
   
40
    expdiff = a.parts.exp - b.parts.exp;
40
    expdiff = a.parts.exp - b.parts.exp;
41
    if (expdiff < 0) {
41
    if (expdiff < 0) {
42
        if (isFloat32NaN(b)) {
42
        if (isFloat32NaN(b)) {
43
            /* TODO: fix SigNaN */
43
            /* TODO: fix SigNaN */
Line 141... Line 141...
141
/** Add two Float64 numbers with same signs
141
/** Add two Float64 numbers with same signs
142
 */
142
 */
143
float64 addFloat64(float64 a, float64 b)
143
float64 addFloat64(float64 a, float64 b)
144
{
144
{
145
    int expdiff;
145
    int expdiff;
146
    __u32 exp1, exp2;
146
    uint32_t exp1, exp2;
147
    __u64 frac1, frac2;
147
    uint64_t frac1, frac2;
148
   
148
   
149
    expdiff = ((int )a.parts.exp) - b.parts.exp;
149
    expdiff = ((int )a.parts.exp) - b.parts.exp;
150
    if (expdiff < 0) {
150
    if (expdiff < 0) {
151
        if (isFloat64NaN(b)) {
151
        if (isFloat64NaN(b)) {
152
            /* TODO: fix SigNaN */
152
            /* TODO: fix SigNaN */