s1s0 / toped

Cross platform, open source IC layout editor
http://www.toped.org.uk/
GNU General Public License v2.0
15 stars 8 forks source link

Conversion real->int in TELL differs from C #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
void test() {

  real r1 = 1;
  real r2 = 2;
  real r3 = 3;

  int i1 = r1/r3; //should result in 0
  echo (i1); //OK

  int i2 = r2/r3; //should give 0 
  echo (i2); //not OK --> result is 1: rounding for that case is not C-like

}

Original issue reported on code.google.com by krustev....@gmail.com on 9 May 2010 at 10:43

GoogleCodeExporter commented 9 years ago
Fixed (changed) in r1536 & r1537. The internal rint() was removed in the first 
one. Then a tell version of rint() was added in case a rounding is required.

Original comment by krustev....@gmail.com on 8 Jun 2010 at 11:23

GoogleCodeExporter commented 9 years ago

Original comment by krustev....@gmail.com on 1 Apr 2012 at 12:19