Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Issue 10959067: Add documentation of double and int. (Closed)

Created:
8 years, 3 months ago by Mads Ager (google)
Modified:
8 years, 3 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add documentation of double and int. There is a bit of comment duplication in here, but I think it is worth it to have all the methods documented on api.dartlang.org for all the types. R=lrn@google.com BUG=dartbug.com/4668 Committed: https://code.google.com/p/dart/source/detail?r=12773

Patch Set 1 #

Total comments: 10

Patch Set 2 : Address review comments. #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -15 lines) Patch
M lib/core/double.dart View 2 chunks +50 lines, -7 lines 7 comments Download
M lib/core/int.dart View 1 2 chunks +44 lines, -8 lines 0 comments Download
M lib/core/num.dart View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Mads Ager (google)
8 years, 3 months ago (2012-09-24 11:31:35 UTC) #1
Lasse Reichstein Nielsen
LGTM! https://codereview.chromium.org/10959067/diff/1/lib/core/double.dart File lib/core/double.dart (right): https://codereview.chromium.org/10959067/diff/1/lib/core/double.dart#newcode58 lib/core/double.dart:58: * [:(3.5).round() == 4:] and [:(-3.5).round() == -4:]. ...
8 years, 3 months ago (2012-09-24 11:54:12 UTC) #2
Mads Ager (google)
https://codereview.chromium.org/10959067/diff/1/lib/core/double.dart File lib/core/double.dart (right): https://codereview.chromium.org/10959067/diff/1/lib/core/double.dart#newcode58 lib/core/double.dart:58: * [:(3.5).round() == 4:] and [:(-3.5).round() == -4:]. On ...
8 years, 3 months ago (2012-09-24 12:26:27 UTC) #3
floitsch
LGTM. https://codereview.chromium.org/10959067/diff/5001/lib/core/double.dart File lib/core/double.dart (right): https://codereview.chromium.org/10959067/diff/5001/lib/core/double.dart#newcode58 lib/core/double.dart:58: * [:(3.5).round() == 4:] and [:(-3.5).round() == -4:]. ...
8 years, 3 months ago (2012-09-24 15:56:14 UTC) #4
Lasse Reichstein Nielsen
https://codereview.chromium.org/10959067/diff/5001/lib/core/double.dart File lib/core/double.dart (right): https://codereview.chromium.org/10959067/diff/5001/lib/core/double.dart#newcode85 lib/core/double.dart:85: * [:d == double.parse(d.toString()):]. Including NaN, actually, since double.parse("NaN") ...
8 years, 3 months ago (2012-09-24 17:52:46 UTC) #5
Lasse Reichstein Nielsen
https://codereview.chromium.org/10959067/diff/5001/lib/core/double.dart File lib/core/double.dart (right): https://codereview.chromium.org/10959067/diff/5001/lib/core/double.dart#newcode58 lib/core/double.dart:58: * [:(3.5).round() == 4:] and [:(-3.5).round() == -4:]. If ...
8 years, 3 months ago (2012-09-24 17:56:42 UTC) #6
floitsch
8 years, 3 months ago (2012-09-24 20:17:27 UTC) #7
https://codereview.chromium.org/10959067/diff/5001/lib/core/double.dart
File lib/core/double.dart (right):

https://codereview.chromium.org/10959067/diff/5001/lib/core/double.dart#newco...
lib/core/double.dart:58: *  [:(3.5).round() == 4:] and [:(-3.5).round() == -4:].
On 2012/09/24 17:56:42, Lasse Reichstein Nielsen wrote:
> If the return type is double, I think -0.0 is the correct result.
> Now, should the result type actually be double?
good point. I had thought a lot about this, and iirc my feeling was, that
round/floor/ceil is almost always used as integer. So I agree with you: it
should return an integer.
Ideally the VM should optimize x.ceil().toDouble() to make sure that the user
pays a big perf-penalty.

https://codereview.chromium.org/10959067/diff/5001/lib/core/double.dart#newco...
lib/core/double.dart:85: * [:d == double.parse(d.toString()):].
On 2012/09/24 17:52:46, Lasse Reichstein Nielsen wrote:
> Including NaN, actually, since double.parse("NaN") is NaN.
but we don't have NaN == NaN.

Powered by Google App Engine
This is Rietveld 408576698