hex

hex --  converts numbers into hexadecimal form.

Syntax

hex (number)

		

Arguments

number

Any number.

Returns

An integer number in hexadecimal format.

Description

This function casts any number to an integer, and returns it in a hexadecimal representation. Floating point numbers are truncated.

Example

    Gamma> hex (12);
    0xc
    Gamma> hex (12.9341);
    0xc
    Gamma> hex (0b111011);
    0x3b
    Gamma> hex ('r');
    0x72
    Gamma> 
    		

See Also

bin, dec, oct

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.