# Inequality help

**URL:** <https://cl.desmos.com/t/inequality-help/4575>\
**Category:** Questions\
**Tags:** validation, correctness\
**Created:** [November 18, 2022, 5:19pm UTC](https://cl.desmos.com/t/inequality-help/4575 "2022-11-18T17:19:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denise\_Melchert](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/denise_melchert/32/3954_2.png) [@Denise\_Melchert](https://cl.desmos.com/u/Denise_Melchert)\
**Post date:** [November 18, 2022, 5:19pm UTC](https://cl.desmos.com/t/inequality-help/4575/1 "2022-11-18T17:19:47Z")

</div>

I am trying to figure out he code to check when a student enters the correct inequality. Example  
0.80x + 35 \< 50

I want it allow things like .8x + 35

HELP

I have figured out how to code for a simple inequality like x\<4, but this one has me stumped.

---

<div class="post-metadata">

**Author:** ![StoyanNYC](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/stoyannyc/32/2967_2.png) [@StoyanNYC](https://cl.desmos.com/u/StoyanNYC)\
**Post date:** [November 19, 2022, 12:44am UTC](https://cl.desmos.com/t/inequality-help/4575/2 "2022-11-19T00:44:05Z")

</div>

Here is a check for the inequality you provided:

> **[Inequality check • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/63782517cde8c7ba6c1c1b44)**
>
> by Stoyan Stoyanov

The code that ensures the left-hand side (lhs) is correct is this:

f1=simpleFunction(parseInequality(input1.latex).lhs)  
check1=f1.evaluateAt(0)=35 and f1.evaluateAt(1)=35.8

The check evaluates the left-hand side expression for 2 values of x (since for a linear expression that is enough to ensure uniqueness). If you want to change the inequality, you need to change the check part. I hope this helps.

---

<div class="post-metadata">

**Author:** ![Denise\_Melchert](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/denise_melchert/32/3954_2.png) [@Denise\_Melchert](https://cl.desmos.com/u/Denise_Melchert)\
**Post date:** [November 22, 2022, 3:09pm UTC](https://cl.desmos.com/t/inequality-help/4575/3 "2022-11-22T15:09:09Z")

</div>

thanks so much! Will give this a try.
