0
|
1 NAME
|
|
2 ConversionsUtil
|
|
3
|
|
4 SYNOPSIS
|
|
5 use ConversionsUtil;
|
|
6
|
|
7 use ConversionsUtil qw(:math);
|
|
8
|
|
9 use ConversionsUtil qw(:all);
|
|
10
|
|
11 DESCRIPTION
|
|
12 ConversionsUtil module provides the following functions:
|
|
13
|
|
14 BinaryToDecimal, BinaryToHexadecimal, DecimalToBinary,
|
|
15 DecimalToHexadecimal, DecimalToOctal, DegreesToRadians,
|
|
16 HexadecimalToBinary, HexadecimalToDecimal, HexadecimalToOctal,
|
|
17 OctalToDecimal, OctalToHexadecimal, RadiansToDegrees, StringToBinary,
|
|
18 StringToHexadecimal
|
|
19
|
|
20 FUNCTIONS
|
|
21 BinaryToDecimal
|
|
22 $Decimal = BinaryToDecimal($Binary);
|
|
23
|
|
24 Converts a *Binary* string to Decimal string.
|
|
25
|
|
26 BinaryToHexadecimal
|
|
27 $Hexadecimal = BinaryToHexadecimal($Binary);
|
|
28
|
|
29 Converts a *Binary* string to Hexadecimal string.
|
|
30
|
|
31 DecimalToBinary
|
|
32 $Binary = DecimalToBinary($Decimal);
|
|
33
|
|
34 Converts a *Decimal* string to Binary string.
|
|
35
|
|
36 DecimalToHexadecimal
|
|
37 $Hexadecimal = DecimalToHexadecimal($Decimal);
|
|
38
|
|
39 Converts a *Decimal* string to Hexadecimal string.
|
|
40
|
|
41 DecimalToOctal
|
|
42 $Octal = DecimalToOctal($Decimal);
|
|
43
|
|
44 Converts a *Decimal* string to Octal string.
|
|
45
|
|
46 DegreesToRadians
|
|
47 $Radians = DegreesToRadians($Degrees, [$DoNotWrapValue]);
|
|
48
|
|
49 Converts degrees to radians in the range from 0 to 2PI or to
|
|
50 corresponding radians without wrapping the converted value to 0 to
|
|
51 2PI. Default is to wrap the converted value.
|
|
52
|
|
53 HexadecimalToBinary
|
|
54 $Binary = HexadecimalToBinary($Hexadecimal);
|
|
55
|
|
56 Converts a *Hexadecimal* string to Binary string.
|
|
57
|
|
58 HexadecimalToDecimal
|
|
59 $Decimal = HexadecimalToDecimal($Hexadecimal);
|
|
60
|
|
61 Converts a *Hexadecimal* string to Decimal string.
|
|
62
|
|
63 HexadecimalToOctal
|
|
64 $Octal = HexadecimalToOctal($Hexadecimal);
|
|
65
|
|
66 Converts a *Hexadecimal* string to Octal string.
|
|
67
|
|
68 OctalToDecimal
|
|
69 $Decimal = OctalToDecimal($Octal);
|
|
70
|
|
71 Converts a *Octal* string to Decimal string.
|
|
72
|
|
73 OctalToHexadecimal
|
|
74 $Hexadecimal = OctalToHexadecimal($Octal);
|
|
75
|
|
76 Converts a *Octal* string to Hexadecimal string.
|
|
77
|
|
78 RadiansToDegrees
|
|
79 $Degrees = RadiansToDegrees($Radians, [$DoNotWrapValue]);
|
|
80
|
|
81 Converts radians to degrees in the range from 0 to 360 or to
|
|
82 corresponding degrees without wrapping the converted value to 0 to
|
|
83 360. Default is to wrap the converted value.
|
|
84
|
|
85 StringToBinary
|
|
86 $BinaryString = StringToBinary($String, [$UseReverseBitOrder]);
|
|
87
|
|
88 Converts specified *String* into a Binarystring. Going from left to
|
|
89 right, two ways of arranging bits inside each byte are available:
|
|
90 Most Significat Bits (MSB) first or Least Significat Bits (LSB)
|
|
91 first. Default is MSB corresponding to descending bits order
|
|
92 (PerlSpeak) inside each each packed byte (Most singificat bits
|
|
93 first).
|
|
94
|
|
95 StringToHexadecimal
|
|
96 $HexadecimalString = StringToHexadecimal($String,
|
|
97 [$UseReverseBitOrder]);
|
|
98
|
|
99 Convert string into a hexadecimal string. Two ways of arranging
|
|
100 nybbles (pair of 4 bits in each byte) are available: high nybbles
|
|
101 first or low nybbles first. Default is MSB corresponding to high
|
|
102 nybbles (PerlSpeak) first. Low and high nybbles correspond to pair
|
|
103 of a low and high four bits in a byte.
|
|
104
|
|
105 AUTHOR
|
|
106 Manish Sud <msud@san.rr.com>
|
|
107
|
|
108 SEE ALSO
|
|
109 Constants.pm, MathUtil.pm
|
|
110
|
|
111 COPYRIGHT
|
|
112 Copyright (C) 2015 Manish Sud. All rights reserved.
|
|
113
|
|
114 This file is part of MayaChemTools.
|
|
115
|
|
116 MayaChemTools is free software; you can redistribute it and/or modify it
|
|
117 under the terms of the GNU Lesser General Public License as published by
|
|
118 the Free Software Foundation; either version 3 of the License, or (at
|
|
119 your option) any later version.
|
|
120
|