Skip to content

Commit da53c26

Browse files
author
Scott Murray
committed
Fixes #96 by clarifying descriptions of boolean() byte() char() float() int() and str()
1 parent 0027df8 commit da53c26

7 files changed

Lines changed: 19 additions & 7 deletions

File tree

content/api_en/binary.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ println(binary(c, 16)); // Prints "1100110000000000"
2222

2323

2424
<description><![CDATA[
25-
Converts a byte, char, int, or color to a String containing the equivalent binary notation. For example, the color value produced by <b>color(0, 102, 153, 255)</b> will convert to the String value "11111111000000000110011010011001". This function can help make your geeky debugging sessions much happier.<br/>
25+
Converts an <b>int</b>, <b>byte</b>, <b>char</b>, or <b>color</b> to a <b>String</b> containing the equivalent binary notation. For example, the <b>color</b> value produced by <b>color(0, 102, 153, 255)</b> will convert to the <b>String</b> value <b>"11111111000000000110011010011001"</b>. This function can help make your geeky debugging sessions much happier.<br/>
2626
<br/>
2727
Note that the maximum number of digits is 32, because an <b>int</b> value can only represent up to 32 bits. Specifying more than 32 digits will have no effect.
2828
]]></description>

content/api_en/include/booleanconvert.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ if (b) {
2020
</example>
2121

2222
<description><![CDATA[
23-
Converts an int, string, or array to its boolean representation. For int calues, the number 0 evaluates to false and all other numbers evaluate to true.
23+
Converts an <b>int</b> or <b>String</b> to its boolean representation. For an <b>int</b>, any non-zero value (positive or negative) evaluates to true, while zero evaluates to false. For a <b>String</b>, the value <b>"true"</b> evaluates to true, while any other value (including <b>"false"</b> or <b>"hippopotamus"</b>) evaluates to false.<br />
24+
<br />
25+
When an array of <b>int</b> or <b>String</b> values is passed in, then a <b>boolean</b> array of the same length is returned.
2426
]]></description>
2527

2628
</root>

content/api_en/include/byteconvert.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ println(i + " : " + b); // Prints "130 : -126"
2020
</example>
2121

2222
<description><![CDATA[
23-
Converts a primitive datatype or array to its byte representation. A byte can only be a whole number between -128 and 127, therefore when a number outside this range is converted, its value wraps to the corresponding byte representation.
23+
Converts any value of a primitive data type (<b>boolean</b>, <b>byte</b>, <b>char</b>, <b>color</b>, <b>double</b>, <b>float</b>, <b>int</b>, or <b>long</b>) to its byte representation. A byte can only be a whole number between <b>-128</b> and <b>127</b>, so when a value outside of this range is converted, it wraps around to the corresponding byte representation. (For example, <b>byte(128)</b> evaluates to <b>-128</b>.)<br />
24+
<br />
25+
When an array of values is passed in, then a <b>byte</b> array of the same length is returned.
2426
]]></description>
2527

2628
</root>

content/api_en/include/charconvert.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ println(b + " : " + c); // Prints "65 : A"
2020
</example>
2121

2222
<description><![CDATA[
23-
Converts a primitive datatype or array to a numeric character representation.
23+
Converts any value of a primitive data type (<b>boolean</b>, <b>byte</b>, <b>char</b>, <b>color</b>, <b>double</b>, <b>float</b>, <b>int</b>, or <b>long</b>) to its numeric character representation.<br />
24+
<br />
25+
When an array of values is passed in, then a <b>char</b> array of the same length is returned.
2426
]]></description>
2527

2628
</root>

content/api_en/include/floatconvert.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ println(i + " : " + f); // Prints "65 : 65.0"
1616
</example>
1717

1818
<description><![CDATA[
19-
Converts an int, string, or array to its floating point representation.
19+
Converts an <b>int</b> or <b>String</b> to its floating point representation. An <b>int</b> is easily converted to a <b>float</b>, but the contents of a <b>String</b> must resemble a number, or <b>NaN</b> (not a number) will be returned. For example, <b>float("1234.56")</b> evaluates to <b>1234.56</b>, but <b>float("giraffe")</b> will return <b>NaN</b>.<br />
20+
<br />
21+
When an array of <b>int</b> or <b>String</b> values is passed in, then a floating point array of the same length is returned.
2022
]]></description>
2123

2224
</root>

content/api_en/include/intconvert.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ println(c + " : " + i); // Prints "E : 69"
2020
</example>
2121

2222
<description><![CDATA[
23-
Converts a primitive datatype, string, or array to its integer representation.
23+
Converts any value of a primitive data type (<b>boolean</b>, <b>byte</b>, <b>char</b>, <b>color</b>, <b>double</b>, <b>float</b>, <b>int</b>, or <b>long</b>) to its integer representation.<br />
24+
<br />
25+
When an array of values is passed in, then an <b>int</b> array of the same length is returned.
2426
]]></description>
2527

2628
</root>

content/api_en/include/strconvert.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ println(sb); // Prints 'false-28R-32.61024'
2929
</example>
3030

3131
<description><![CDATA[
32-
Returns the string representation of primitive datatypes and arrays. For example the integer 3 will return the string "3", the float -12.6 will return the string "-12.6", and a boolean value true will return the string "true".
32+
Converts any value of a primitive data type (<b>boolean</b>, <b>byte</b>, <b>char</b>, <b>color</b>, <b>double</b>, <b>float</b>, <b>int</b>, or <b>long</b>) to its <b>String</b> representation. For example, converting an integer with <b>str(3)</b> will return the <b>String</b> value of <b>"3"</b>, converting a float with <b>str(-12.6)</b> will return <b>"-12.6"</b>, and converting a boolean with <b>str(true)</b> will return <b>"true"</b>.<br />
33+
<br />
34+
When an array of values is passed in, then a <b>String</b> array of the same length is returned.
3335
]]></description>
3436

3537
</root>

0 commit comments

Comments
 (0)