bin

Gamma: Version 4.0
Prev |  | Next

# `bin`

`bin` -- converts numbers into binary form.

## Syntax

    bin (number)

## Arguments

`number`

  Any number.

## Returns

An integer number in binary format.

## Description

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

## Example

        Gamma> bin(12);
        0b1100
        Gamma> bin(12.9342);
        0b1100
        Gamma> bin(0x3b);
        0b00111011
        Gamma> bin(0o436);
        0b000100011110
        Gamma>

## See Also

`dec`, `hex`, `oct`

Prev | Home | Next
Data Type Conversion | Up | `char`

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