Thread overview | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
May 24, 2002 error | ||||
---|---|---|---|---|
| ||||
Any posibility that I'm getting this? Assertion failure: 'ie' on line 253 in file 'declaration.c' abnormal program termination My objective is to create 2 functions: MMult (to multiply matrixes) and MInv (to invert a matrix), and they're already implemented but when I attempt to try them with 2x2 matrixes, I get that message. ------------------------- Carlos 8294 http://carlos3.netfirms.com/ |
May 24, 2002 Re: error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos | "Carlos" <carlos8294@msn.com> wrote in message news:aclrb6$o6c$1@digitaldaemon.com... > Assertion failure: 'ie' on line 253 in file 'declaration.c' > > abnormal program termination This happens sometimes. Try commenting out different blocks of code till you find the line which causes the error. Then you might want to report this to Walter. BTW, I suggest you first check for things like structures declared on stack and initialized, and also static arrays on stack - it caused the compiler to crash sometimes in older releases... |
May 24, 2002 Re: error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos | "Carlos" <carlos8294@msn.com> wrote in message news:aclrb6$o6c$1@digitaldaemon.com... > Any posibility that I'm getting this? > > Assertion failure: 'ie' on line 253 in file 'declaration.c' > > abnormal program termination Any such is a compiler bug. Please post/email me a reproducible example so I can fix it. Thanks, -Walter |
May 24, 2002 Re: error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | I could fix it. But the solution leads me to give you a suggestion: though you claim (in all your right) that resizing arrays is easy, resizing multidimensional arrays is really hard. I had to do this: int size=2; //or any value double a[][]; a.length=size; for (int i=0;i<a.length;i++) a[i].length=size; Too complicated. I can't think about an easy way to do it, but probably you should. Besides, there's no way to do this: void foo(double [][]a) { ... } double [2][2] a; foo(a); The compiler says there's no compatibility. I hope it's a bug because if it's not, then you should do something about it. The compiler also says that it can't be done: double a; a=abs(a); Because there's no difference between abs ( extended ) and abs ( int ). Isn't it ridiculous? "Walter" <walter@digitalmars.com> escribió en el mensaje news:acm3cj$vbc$1@digitaldaemon.com... > > "Carlos" <carlos8294@msn.com> wrote in message news:aclrb6$o6c$1@digitaldaemon.com... > > Any posibility that I'm getting this? > > > > Assertion failure: 'ie' on line 253 in file 'declaration.c' > > > > abnormal program termination > > Any such is a compiler bug. Please post/email me a reproducible example so I > can fix it. Thanks, -Walter > > |
May 24, 2002 Re: error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos | "Carlos" <carlos8294@msn.com> escribió en el mensaje news:acmglh$1cbb$1@digitaldaemon.com... > I could fix it. But the solution leads me to give you a suggestion: though you claim (in all your right) that resizing arrays is easy, resizing multidimensional arrays is really hard. I had to do this: > > int size=2; //or any value > double a[][]; > a.length=size; > for (int i=0;i<a.length;i++) > a[i].length=size; > > Too complicated. I can't think about an easy way to do it, but probably you > should. It leads to something: resizing three-dimensional, four-dimensional, etc. arrays becomes painful. |
May 24, 2002 Re: error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos | Due to the same program, this has come to me: how does D compare floating point numbers: C-like (floatingPoint1==floatingPoint2 is always false) or differently (sometimes floatingPoint1==floatingPoint2 is true)? For example, double a=1; double b=1; if (a==b) ... ; It should be true. |
May 25, 2002 Re: error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos | "Carlos" <carlos8294@msn.com> wrote in message news:acmglh$1cbb$1@digitaldaemon.com... > The compiler also says that it can't be done: > double a; > a=abs(a); > Because there's no difference between abs ( extended ) and abs ( int ). > Isn't it ridiculous? It's an old story. Since it has to convert double anyhow (either to int or to extended), it treats both in the same way. And yes, it seems weird to me. However, Walter does not want to make the overloading rules more comlicated, so the only solution currently is to perform a cast if you use Phobos, and if you write your own library and want it to work properly, you have to overload the function for ALL types. |
May 25, 2002 Re: error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | I understand that, but what about a swap function? It also has to be overloaded for ALL types and the parameters have to be out or inout, but then it has to cast float or double and the compiler says (because it also happened to me) that cast(extended) { something I don't remember well } is not a lvalue. Probably you (or Walter) should reconsider your ideas about the program. "Pavel Minayev" <evilone@omen.ru> escribió en el mensaje news:acn1t5$1qfv$1@digitaldaemon.com... > "Carlos" <carlos8294@msn.com> wrote in message news:acmglh$1cbb$1@digitaldaemon.com... > > > The compiler also says that it can't be done: > > double a; > > a=abs(a); > > Because there's no difference between abs ( extended ) and abs ( int ). > > Isn't it ridiculous? > > It's an old story. Since it has to convert double anyhow (either to int or to extended), it treats both in the same way. And yes, it seems weird to me. However, Walter does not want to make the overloading rules more comlicated, so the only solution currently is to perform a cast if you use Phobos, and if you write your own library and want it to work properly, you have to overload the function for ALL types. > > |
May 25, 2002 Re: error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | I understand that, but what about a swap function? It also has to be overloaded for ALL types and the parameters have to be out or inout, but then it has to cast float or double and the compiler says (because it also happened to me) that cast(extended) { something I don't remember well } is not a lvalue. Probably you (or Walter) should reconsider your ideas about the language. "Pavel Minayev" <evilone@omen.ru> escribió en el mensaje news:acn1t5$1qfv$1@digitaldaemon.com... > "Carlos" <carlos8294@msn.com> wrote in message news:acmglh$1cbb$1@digitaldaemon.com... > > > The compiler also says that it can't be done: > > double a; > > a=abs(a); > > Because there's no difference between abs ( extended ) and abs ( int ). > > Isn't it ridiculous? > > It's an old story. Since it has to convert double anyhow (either to int or to extended), it treats both in the same way. And yes, it seems weird to me. However, Walter does not want to make the overloading rules more comlicated, so the only solution currently is to perform a cast if you use Phobos, and if you write your own library and want it to work properly, you have to overload the function for ALL types. > > |
May 25, 2002 Re: error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos | "Carlos" <carlos8294@msn.com> wrote in message news:acmid0$1dtp$1@digitaldaemon.com... > Due to the same program, this has come to me: how does D compare floating point numbers: C-like (floatingPoint1==floatingPoint2 is always false) or differently (sometimes floatingPoint1==floatingPoint2 is true)? For example, > > double a=1; > double b=1; > if (a==b) ... ; > > It should be true. You're right, it should be true. Is it not in D? |
Copyright © 1999-2021 by the D Language Foundation