Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

update number conversions #2

Merged
merged 3 commits into from
Aug 21, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/site/_includes/language-tour/3-built-in-types/lists.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ <h4> List and Collection methods </h4>
returns a new collection with only the elements that satisfy a condition.
The <a href="http://api.dartlang.org/dart_core/Collection.html#every">every()</a> and
<a href="http://api.dartlang.org/dart_core/Collection.html#some">some()</a> methods
check whether a collection matches
every condition or at least one condition, respectively.
check whether every item in a collection matches a condition
or if at least one item matches a condition, respectively.
The <a href="http://api.dartlang.org/dart_core/List.html#sort">sort()</a> method
lets you sort a list using any criteria you like.
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@
</p>

{% highlight dart %}
#import('dart:math'); // Needed for math functions. See libraries section

// String -> int
var one = Math.parseInt("1");
var one = parseInt("1");
assert(one == 1);

// String -> double
var onePointOne = Math.parseDouble("1.1");
var onePointOne = parseDouble("1.1");
assert(onePointOne == 1.1);

// int -> String
Expand All @@ -80,7 +82,7 @@
</p>

{% highlight dart %}
assert((3 < 1) == 6); // 0011 << 1 == 0110
assert((3 << 1) == 6); // 0011 << 1 == 0110
assert((3 >> 1) == 1); // 0011 >> 1 == 0001
assert((3 | 4) == 7); // 0011 | 0100 == 0111
{% endhighlight %}