11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Math and Time FunctionsThe following are reference pages for intrinsic functions that perform math operations andtime and date operations. These functions supplement the <strong>Caché</strong> <strong>ObjectScript</strong> general functionsdescribed earlier in this document. Functions are listed in alphabetical order.Further introductory information on function syntax and conventions is provided at thebeginning of the general functions reference pages. Additional information on <strong>Caché</strong> functionscan be found in the Functions chapter of Using <strong>Caché</strong> <strong>ObjectScript</strong>.$ZABSAbsolute value function.$ZABS(n)ParametersnAny number.Description$ZABS returns the absolute value of n.ParametersnAny number. Can be specified as a value, a variable, or an expression. The expression isevaluated, and the result converted to a positive value. Multiple plus and minus signs arepermitted. Leading and trailing zeros are deleted.ExampleThe following program returns the absolute value of the number you supply.READ "Input a number: ",numSET abs=$ZABS(num)WRITE "The absolute value of ",num," is ",abs<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 315

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!