PSeInt Abs: absolute value
Gives the absolute value: the number without its sign, that is, how far it is from zero. Handy for differences regardless of which is bigger.
- Group:
- Math Functions
- Template
Abs
Opens the editor with this example loaded. Run it step by step and watch the flowchart.
Worked example
A complete algorithm, ready to copy and run.
Algoritmo Example Escribir Abs(-8)FinAlgoritmoOutput
Shows: 8
This is what the console shows when the example runs.
8In a flowchart
This is how it appears in a flowchart, with the same shapes Codoritmo draws.
Template
The general form. Replace what's inside < > with your own data.
Abs(<numero>)Examples that use it
Programs from the example library where it appears, from the simplest to the most complete.
Guess the Number
Guess a secret number from 1 to 100 in seven tries.
Intermediate
More math functions
Codoritmo is an independent, open-source project inspired by PSeInt and compatible with its syntax. It is not affiliated with the PSeInt project. Official PSeInt website.