About
Docs
Files
Support
Index

Essentials
AutoDocs
Library functions
Cooperate
Process mastering
Debug
Own debugging kit
FGE
Smart modeid pick
Loader
Shared lib. loader
Macros
Helper macros
Structs
All the structures
Logs
Library changelogs
Tools
Progs baked inside

Tools
amiscreen0.3
ansifilter0.1
auto2guide0.1
ccfilter0.1
chipset0.1
cputype0.1
device640.1
dupfilter0.1
expandlogs0.1
findsm0.2
fmpp0.1
fsmount0.1
genanim0.3
gensymtab0.1
hashlab0.4
ktm0.6
linkpoint0.1
logo2ilbm0.1
lpradio0.1
lzwpack0.1
minism0.2
mkheader0.1
modeidctrl0.1
mss0.6
multisum0.3
newterm0.2
numconv0.1
palhack1.1
patmat0.1
pfr0.2
playamitape0.1
qdbflags0.1
qfill0.1
resmodinit0.2
sadctrl0.2
saveassign0.1
setanim0.2
systime0.1
tokendump0.1
uassign0.1
viewlogo0.1
waitback0.4
wrapmount0.1



N
U
M
C
O
N
V

numconv-0.1
------------

---

This is 'numconv' a program that allows to convert between four most common
numeral  systems(BIN - 0b/%, OCT - 0o/q, DEC, HEX - 0x/$). It  also detects
overflows and NaNs and informs about them using '$RC' environment variable.
Signed or unsigned 32/64 bit integers are supported.

---

NOTES:

[*]
Requires  68020(no FPU)+,  OS2.04(theoretically)+, 6+ kilos of free memory.

[*]
Please  note that notation  detection depends  on type of prefix.  This  of
course does not apply to the decimal format.

[*]
All notations allow signedness either at the input and output,  this may be
very handy when there is a need to convert back.

---

HELP:

   > numconv ?

     INTEGER,B=BIN/S,O=OCT/S,I=DEC/S,H=HEX/S,A=ALIGN/S,S=SPFX/S,W=WPFX/S,
     U=UNSIGNED/S,Q=QUAD/S,L=ABS/S



   INTEGER      -  Integer to  be examined or converted. This  input can be
                   digit grouped as all common/mixed standards are handled.

   B=BIN/S      -  Output notation is binary.

   O=OCT/S      -  Output notation is octal.

   I=DEC/S      -  Output notation is decimal(default).

   H=HEX/S      -  Output notation is hexadecimal.

   A=ALIGN/S    -  Align  the output to maximum number of zeros.  Amount of
                   0's depends on word width.

   S=SPFX/S     -  Append single character prefix.

   W=WPFX/S     -  Append double character prefix.

   U=UNSIGNED/S -  Operate  only on  unsigned integers.  Whenever  negative
                   value  is passed  when this is  turned on  then overflow
                   will occurr.

   Q=QUAD/S     -  Extend the word width to  64 bits. By default  32bit ops
                   are used.

   L=ABS/S      -  Makes  the negative  value positive when in signed mode.

---

USAGE:

   ; Convert decimal to binary
   numconv 2013 b

   ; Get rid of digit grouping
   numconv 1,000,000

   ; Convert freaky notation
   numconv "22,1000'000 99" q

   ; Check if input is a number
   failat 11
   numconv >NIL: bo0
   if error
     echo "Oops, NaN was detected, me is scared!"
   endif

   ; Check for overflow if any
   failat 11
   numconv >NIL: -1 u
   if warn
     echo "Oops, value passed in is out of range!"
   endif

---
megacz
    









No more fear cus pure HTML is here!
Copyright (C) 2013-2014 by Burnt Chip Dominators