prevnext   » SZS: Wiimms SZS Toolset » wkclt: Wiimms KCL Tool » wkclt float

wkclt float

This commands helps to convert hex values into floating point numbers and vice versa. For each non empty parameter, a line with 4 bytes hex and a float, 8 bytes hex and a double float, and the parameter itself is printed. If a parameter begins with 'x' or '0x', it is a hex string, otherwise it is a floating point number.

The special parameters "+" and "-" mean: Increment or decrement the previous value by the smallest possible value. Use different increments for floats and doubles.

All conversions are done using big endian.

Contents

1.   Syntax

wkclt FLOAT number...

2.   Options

Options
Option Param Description
--round Print additional lines with rounded values (to 3 and 2 bytes for floats and 7 and 6 bytes for doubles).

3.   Description

The FLOAT command is available for most of the tools. It converts hex numbers into floating point numbers (single and double precision) and vice versa.

A list of numbers is expected as input. Numbers that begin with »x« or »0x« are interpreted as hex numbers. All other numbers are floating point numbers. Exceptions are the special parameters »+« and »«. They increment or decrement the previous value by the smallest possible value. Different increments are used for single and double precision.

Example:

$ wkclt float -- 1 2.5 -3 x40 - 0x4010 + +
 3f80 0000 =            1 : 3ff0 0000 0000 0000 =                      1 : |1|
 4020 0000 =          2.5 : 4004 0000 0000 0000 =                    2.5 : |2.5|
 c040 0000 =           -3 : c008 0000 0000 0000 =                     -3 : |-3|
 4000 0000 =            2 : 4000 0000 0000 0000 =                      2 : |x40|
 3fff ffff =   1.99999988 : 3fff ffff ffff ffff =    1.99999999999999978 : |-|
 4010 0000 =         2.25 : 4010 0000 0000 0000 =                      4 : |0x4010|
 4010 0001 =   2.25000024 : 4010 0000 0000 0001 =    4.00000000000000089 : |+|
 4010 0002 =   2.25000048 : 4010 0000 0000 0002 =    4.00000000000000178 : |+|
Note: The example uses the argument »--«. This is the usual way to indicate that all of the following arguments are parameters, not options. Therefore, the following »-3« is understood as a number.