View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000506 | ascend | pygtk gui | public | 2011-04-09 01:50 | 2013-02-26 13:42 |
Reporter | ujjavalverma10 | ||||
Assigned To | john | ||||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | resolved | Resolution | no change required | ||
Platform | Linux | OS | Ubuntu | OS Version | 9.04 |
Product Version | 0.9.7 | ||||
Target Version | 0.9.9 | Fixed in Version | |||
Summary | 0000506: Divide by Zero error even when the divisor is non-zero | ||||
Description | When ASCEND loads a model in the PyGTK GUI and it is solved, Although the model is solved correctly, But the Errors/Warnings window displays 'Divide by zero in 1/x expr .....' error message if the model involves 1/(a-b) sort of equations. This happens even when (a-b) != 0. | ||||
Tags | No tags attached. | ||||
|
This is actually a false warning which is generated by the safe_rec() method of ascend/compiler/safe.c file : double safe_rec(double x,enum safe_err *safe) { if( x == 0.0 ) { double bogus = BIGNUM; if( safe_print_errors ) { ERROR_REPORTER_NOLINE(ASC_USER_ERROR,"Divide by zero in 1/x expr: returning %g",bogus); } *safe = safe_div_by_zero; return( bogus ); } return( 1.0/x ); } |
|
Not sure why you think the above code results in divided-by-zero error messages even when (a-b)!=0. FWIW the errors arise during the iterative solution process, so values can be tried that are different from the initial values of the variables in many cases. |
|
This is not a bug: the code works as expected. If you can provide a better example, please do so and we will re-open the bug. |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-04-09 01:50 | ujjavalverma10 | New Issue | |
2011-04-09 02:18 | ujjavalverma10 | Note Added: 0000716 | |
2011-04-09 13:27 | john | Note Added: 0000719 | |
2011-04-12 09:46 | john | Note Added: 0000733 | |
2011-04-12 09:46 | john | Status | new => resolved |
2011-04-12 09:46 | john | Resolution | open => no change required |
2011-04-12 09:46 | john | Assigned To | => john |
2013-02-26 13:42 | john | Target Version | => 0.9.9 |