This documentation is out of date.

The new version of the documentation is here: https://cannylogic.com/docs

Difference between revisions of "ASCII to Integer"

From CANNY Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
__NOTOC__
  
 
<div style="float:right;margin:5px;">
 
<div style="float:right;margin:5px;">
Line 6: Line 7:
 
!colspan="2" style="background-color:#AFEEEE;"|Appearance
 
!colspan="2" style="background-color:#AFEEEE;"|Appearance
 
|-
 
|-
|colspan="2" align="center" style="padding:10px;"|[[Изображение:5_10_5_2.png]]
+
|colspan="2" align="center" style="padding:10px;"|[[File:5_10_5_2.png]]
 
|-
 
|-
 
!colspan="2" style="background-color:#AFEEEE;"|Symbol
 
!colspan="2" style="background-color:#AFEEEE;"|Symbol
Line 18: Line 19:
 
!colspan="2" style="background-color:#AFEEEE;"|Inputs
 
!colspan="2" style="background-color:#AFEEEE;"|Inputs
 
|-
 
|-
|style="padding-left:1em;"|Symbols 1 & 0:
+
|style="padding-left:1em;"|Characters 1 & 0:
|style="padding-left:1em;"|[[Конвертер строки символов в число#Примечания|пара ASCII символов]]
+
|style="padding-left:1em;"|[[#Notes|A pair of  ASCII characters]]
 
|-
 
|-
 
|style="padding-left:1em;"|...
 
|style="padding-left:1em;"|...
 
|style="padding-left:1em;"|...
 
|style="padding-left:1em;"|...
 
|-
 
|-
|style="padding-left:1em;"|Symbols 15 & 14:
+
|style="padding-left:1em;"|Characters 15 & 14:
|style="padding-left:1em;"|[[Конвертер строки символов в число#Примечания|пара ASCII символов]]
+
|style="padding-left:1em;"|[[#Notes|A pair of  ASCII characters]]
 
|-
 
|-
|style="padding-left:1em;"|Основание:
+
|style="padding-left:1em;"|Base:
|style="padding-left:1em;"|[[Язык CFD#Данные|числовой]]
+
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]
 
|-
 
|-
 
!colspan="2" style="background-color:#AFEEEE;"|Outputs
 
!colspan="2" style="background-color:#AFEEEE;"|Outputs
 
|-
 
|-
 
|style="padding-left:1em;"|Number:
 
|style="padding-left:1em;"|Number:
|style="padding-left:1em;"|[[Язык CFD#Данные|числовой]]
+
|style="padding-left:1em;"|[[CFD Language#Data|Integer]]
 
|-
 
|-
 
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]
 
!colspan="2" style="background-color:#AFEEEE;"|Version [[CANNY Lab]]
 
|-
 
|-
|colspan="2" align="center"|с 1.8
+
|colspan="2" align="center"|from 1.8
 
|}
 
|}
 
</div>
 
</div>
Line 43: Line 44:
 
<div style="min-height:100%;display:block;">
 
<div style="min-height:100%;display:block;">
 
<div style="float:left;width:70px;">
 
<div style="float:left;width:70px;">
[[Изображение:5_10_5_1.png|left|Иконка]]
+
[[File:5_10_5_1.png|left|Icon]]
 
</div>
 
</div>
  
 
<div>
 
<div>
Converts the number string representation for a given base 2, 10 or 16 in to a numeric value.
+
Converts the string representation of a number for a given base 2, 10 or 16 into a numeric value.
  
The original string must contain, valid in the selected numeral system, characters on the positions: 0..15, 11..15 or 12..15 for a given bases 2, 10 and 16, respectively.
+
The original string must contain valid characters in the selected numeral system on the positions: 0..15, 11..15 or 12..15 for a given base 2, 10 and 16, respectively.
  
 
</div>
 
</div>
Line 60: Line 61:
 
In case of invalid characters presence on inputs, the value of the output will be set to 0.
 
In case of invalid characters presence on inputs, the value of the output will be set to 0.
  
In the case of using an invalid base value output value will be set to 0.
+
In the case of using an invalid base, value output value will be set to 0.
  
 
== Examples ==
 
== Examples ==
 
{|
 
{|
 
|- valign="top"
 
|- valign="top"
|[[Изображение:5_10_5_3.png|thumb|«0101101110100000» по основанию  2 =  23456]]
+
|[[File:5_10_5_3.png|thumb|«0101101110100000» base 2 =  23456]]
|[[Изображение:5_10_5_4.png|thumb|«0000000000123456» по основанию 10 =  23456 (символ "1" отброшен)]]
+
|[[File:5_10_5_4.png|thumb|«0000000000123456» base 10 =  23456 (symbol "1" is supressed)]]
 
|- valign="top"
 
|- valign="top"
|[[Изображение:5_10_5_5.png|thumb|«00000000000F5Ba0» по основанию 16 =  23456 (символ "F" отброшен)]]
+
|[[File:5_10_5_5.png|thumb|«00000000000F5Ba0» base 16 =  23456 (symbol "F" is supressed)]]
|[[Изображение:5_10_5_6.png|thumb|«0000000000005BG0» по основанию 16 =  0 (недопустимый символ "G")]]
+
|[[File:5_10_5_6.png|thumb|«0000000000005BG0» base 16 =  0 (incorrect symbol "G")]]
 
|}
 
|}
  
Line 88: Line 89:
 
[[Integer to ASCII]]
 
[[Integer to ASCII]]
  
[[Справочник по встроенным функциональным блокам | Встроенные функциональные блоки]]
+
[[Built-in_Function_Blocks | Built-in Function Blocks]]

Latest revision as of 13:47, 23 January 2016


Appearance
5 10 5 2.png
Symbol
ATOI
Group
Converters
Inputs
Characters 1 & 0: A pair of ASCII characters
... ...
Characters 15 & 14: A pair of ASCII characters
Base: Integer
Outputs
Number: Integer
Version CANNY Lab
from 1.8
Icon

Converts the string representation of a number for a given base 2, 10 or 16 into a numeric value.

The original string must contain valid characters in the selected numeral system on the positions: 0..15, 11..15 or 12..15 for a given base 2, 10 and 16, respectively.


Features

Symbols, which set outside of these position ranges, discarded.

In case of invalid characters presence on inputs, the value of the output will be set to 0.

In the case of using an invalid base, value output value will be set to 0.

Examples

«0101101110100000» base 2 = 23456
«0000000000123456» base 10 = 23456 (symbol "1" is supressed)
«00000000000F5Ba0» base 16 = 23456 (symbol "F" is supressed)
«0000000000005BG0» base 16 = 0 (incorrect symbol "G")

Notes

With the release of CANNY Lab version 1.8 a new data presentation added - "A pair of characters" in which the values are represented by two characters ASCII with the codes given by high and low bytes of displaying 16-bit value .

For example, the decimal number 19778 corresponding hexadecimal 0x4B4E, displayed a pair of characters «KN», having ASCII-code 0x4B, and 0x4E respectively.

See also

Converter 8-to-1

Converter 16-to-1

Converter 1-to-8

Converter 1-to-16

Integer to ASCII

Built-in Function Blocks