[Home]
HomePage RecentChanges Frequently Asked Questions

number

_Numbers can be expressed as integers or floating point values_

In awk, numbers can be expressed as decimal [integer]]s or as [[floating_point?]] values.

_Numbers should be specified in decimal_

The awk programming language does not provide facilities for specifying numbers in non [[decimal?]] bases. However numerical values in output can be formatted into [[octal?]] or [[hexadecimal?]].

_Positive and negative numbers_

Negative numbers in awk must be prefixed with a minus numbersign operator:

number = -5

It is also possible to use the plus symbol as a unary numbersign operator to prefix positive numbers. However, this form is generally not required, because numbers are positive by default:

number = +6 # 6 is positive


Edit this page View other revisions Administration
Last edited 2011年03月06日 22:33 UTC by markhobley (diff)

Powered by sdf Creative Commons License <pierre.gaston+awk@gmail.com>

Awk Wiki by #awk is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

AltStyle によって変換されたページ (->オリジナル) /