bugDotGNU Portable.NET - Bugs: bug #10483, Modulus (%) borked

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #10483: Modulus (%) borked

Submitter:  Carl-Adam Brengesjo <ptah>
Submitted:  Thu 23 Sep 2004 04:13:50 PM UTC
   
 
Category:  None Severity:  4 - Important
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Thu 23 Sep 2004 10:26:21 PM UTC, comment #2: 

"fprem" is what should be used in any case, as I discovered
in libjit recently.  I copied "fprem1" from an older version
of Mono a long time ago, and they must have gotten it wrong. 
They have since fixed it, but I didn't notice their fix.
Fix committed to CVS - 24 Sep 2004.

Rhys Weatherley <rweather>
Group administrator
Thu 23 Sep 2004 05:44:41 PM UTC, comment #1: 

I'm attaching my debug results and strangely this looks like a CPU bug ?.

See the float.log for the gdb logs which are clearly strange.
and the md_x86.c.hack for the changes need to start debugging
this problem

Using fprem instead of the IEEE fprem1 fixed the issue, but it's a sad day when FREM doesn't behave like IEEE float specs.


Gopal.V <t3rmin4t0r>
Group administrator
Thu 23 Sep 2004 04:13:50 PM UTC, original submission:  

This is is really borked operation...
A simple mod operation of 3 and 2 results in -1 !!

test.cs:
using System;

class Foo
{
  static void Main()
  {
    Double x1 = 3, x2 = 2, x3 = x1 % x2;
    Console.WriteLine("x3 = {0} = {1} % {2}", x3, x1, x2);
  }
}

pnet output:
x3 = -1 = 3 % 2

expected:
x3 = 1 = 3 % 2

Carl-Adam Brengesjo <ptah>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #1794:  md_x86.c.hack added by t3rmin4t0r (424B - application/octet-stream - md_x86.c debug hacks)
file #1793:  float.log added by t3rmin4t0r (5KiB - text/x-log - gdb log)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-09-23 rweather StatusNone Fixed
    Open/ClosedOpen Closed
2004-09-23 t3rmin4t0r Attached File- Added md_x86.c.hack, #1699
2004-09-23 t3rmin4t0r Attached File- Added float.log, #1698

Back to the top

Powered by Savane 3.12