Solution of an inequality with Reduce[ ] ?

Posted 5 months ago
555 Views
|
2 Replies
|
3 Total Likes
|
 I use mathematica to solve this inequality : (k + 12541)*3.97 - 452.25 < 228660.42 Obviously, the result of this inequality is k < 45170. When k equals 45170, (k + 12541)3.97 - 452.25 equals 228660.42, but after adding Integer* in Reduce, k can equal 45170, but this is wrong, right?
2 Replies
Sort By:
Posted 5 months ago
 The result is a little strange, but in general when you are working with floating point numbers the distinction between < and <= is not so clear. Using Rationalize gives the result you expect: Reduce[Rationalize[(k + 12541)*3.97 - 452.25 < 228660.42], k, Integers] I assume that Reduce does an automatic rationalization too, but it must be doing something slightly different.