Repository navigation
Commit 68e231d
Exceptions from other libraries are checked for before the call (#1561)
Four places caught an exception from code the library does not own, where a
check before the call says the same thing:
- the factorial of an exact integer read the value with `ToInt32IfExact` inside
a bare `catch`; it tests `IsInteger()` and the int32 range first;
- the conversion to `BigInteger` caught `ToInt32Checked`'s `OverflowException` on
the precision; it tests `CanFitInInt32` first, as the rest of the library does;
- a matrix product caught GenericTensor's `InvalidShapeException`; it compares
the shapes first, as `+` and `-` already do;
- a matrix power caught `Pow`'s exception for a non-square matrix; it tests
`IsSquare` first.
`Integer.TryParse` and `Rational.TryParse`, internal and with no callers, are
deleted. `Real.TryParse` still catches, since PeterO.Numbers has no parser that
does not throw, but only `FormatException` now.
Closes #1548.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent e9ad9f2 commit 68e231d
7 files changed
Lines changed: 17 additions & 64 deletions
File tree
- Sources/AngouriMath
- Core/Entity
- Continuous
- Number
- Omni
- Functions
- Evaluation/Evaluation.Continuous
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | 103 | | |
119 | 104 | | |
120 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | 485 | | |
501 | 486 | | |
502 | 487 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 94 | + | |
| 95 | + | |
101 | 96 | | |
102 | | - | |
103 | | - | |
104 | | - | |
| 97 | + | |
| 98 | + | |
105 | 99 | | |
106 | 100 | | |
107 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
| 371 | + | |
378 | 372 | | |
379 | | - | |
380 | | - | |
381 | | - | |
| 373 | + | |
| 374 | + | |
382 | 375 | | |
383 | 376 | | |
384 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
269 | 262 | | |
270 | 263 | | |
271 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1179 | 1179 | | |
1180 | 1180 | | |
1181 | 1181 | | |
1182 | | - | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1183 | 1185 | | |
1184 | | - | |
| 1186 | + | |
1185 | 1187 | | |
1186 | 1188 | | |
1187 | 1189 | | |
1188 | | - | |
1189 | 1190 | | |
1190 | 1191 | | |
1191 | 1192 | | |
| |||
0 commit comments