abs

From the SETL Wiki

Jump to: navigation, search
abs
Category math
Syntax prefix
Compatibility
CIMS SETL yes
SETL-S yes
SETL2 yes
GNU SETL yes

Contents

Purpose

Absolute value of number, character code

Synopsis

 abs x

Description

  • If x is an integer or real number, returns its absolute value.
  • If x is a string, returns the numeric code of the initial character.

Examples

  1. abs 1
    

    Result: 1

  2. abs -42
    

    Result: 1

  3. abs 'a'
    

    Result: 65


Notes

  • All implementations currently use ASCII or ISO-8859-1 as the default (and only) character encoding.
Personal tools