Abs

Constructor

Abs <id> (double init_val)

Action

Computes the absolute value of the input property each time it is updated.

Predefined children

  • DoubleProperty: input, output.

Example


use core
use base
use display
use gui

_main_
Component root {
  Frame f ("myFrame", 0, 0, 500, 500)
  Double x (250)
  Abs abs (0)
  f.move.x - x => abs.input
  TextPrinter log
  abs.output => log.input
}