❔ is this syntax correct

IsUp is a method that gets an array and returns whether it's ordered is a rising way. But it doesn't matter, is this syntax correct? I'm trying to return true if both s and tmp r rising. I'd usually write it as 2 different sections and connecting them w && but I tried this way js bc it's used in math and it doesn't give me any errors but idk if it'll function the way I want it to
No description
4 Replies
MODiX
MODiXβ€’8mo ago
Aaron
REPL Result: Success
false == false == true
false == false == true
Result: bool
True
True
Compile: 387.899ms | Execution: 54.787ms | React with ❌ to remove this embed.
Aaron
Aaronβ€’8mo ago
so no, that doesn't do what you want it's doing (IsUp(s) == IsUp(tmp)) == true if both IsUp's return false, they're equal, which makes the entire thing true
kocha
kochaβ€’8mo ago
the correct thing would be
if(IsUp(s) && IsUp(tmp))
if(IsUp(s) && IsUp(tmp))
Accord
Accordβ€’8mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
c# classExtreme newbie question here. I want to use a foreach loop to Console.WriteLine all the objects. But❔ Newtonsoft JSON trying to serialize list of objects with a two dimensional array "shape" property.I'm getting some errors about additional characters being found in my json when trying to deserializHow to suppress all errors and warnings within namespace (or directory) using GlobalSuppressions.csI have a directory with generated API client code and it does not match coding standards configured ❔ DB and web API data potential desync- how to resolve?I have an app that will cross compare DB contract data to usage data fetched from a web API. The A❔ Load and debug c# scripts in runtimeHello everyone, i need load/reload c# scripts in runtime, and debug that scripts. I am try use this ❔ What to use instead of keycloak for built-in auth?I'm working on the backend for my app. The app was originally going to be a web app, so currently fo❔ Call API From Web API on Blazor ServerHello respected community members, I am new to Blazor Server and I am currently trying to fetch data❔ EF blowing up trying to insert a relationship that already existsCode and question are in the text file❔ Evaluating C# Expressions At RuntimeI am looking alternative ways to evaluate C# expression at runtime. I have used `Roslyn Scripting AP❔ βœ… running a c# program without opening visual studioHow do i run a c# program without opening visual studio on .net framework?