Skip to content

Commit 42f8383

Browse files
committed
statistics_decimal_test.dart
statistics_dynamic_int_test.dart
1 parent 39d24ec commit 42f8383

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

test/statistics_decimal_test.dart

+24
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,30 @@ void main() {
12591259
(~Decimal.parse('-1.00', precision: 2)).toHex(), equals('00000000'));
12601260
});
12611261

1262+
test('sin', () {
1263+
expect(Decimal.fromInt(1).sin,
1264+
equals(Decimal.fromDouble(0.8414709848078965)));
1265+
expect(Decimal.fromInt(-1).sin,
1266+
equals(Decimal.fromDouble(-0.8414709848078965)));
1267+
1268+
expect(Decimal.fromInt(10).sin,
1269+
equals(Decimal.fromDouble(-0.5440211108893699)));
1270+
expect(Decimal.fromInt(-10).sin,
1271+
equals(Decimal.fromDouble(0.5440211108893699)));
1272+
});
1273+
1274+
test('cos', () {
1275+
expect(Decimal.fromInt(1).cos,
1276+
equals(Decimal.fromDouble(0.5403023058681398)));
1277+
expect(Decimal.fromInt(-1).cos,
1278+
equals(Decimal.fromDouble(0.5403023058681398)));
1279+
1280+
expect(Decimal.fromInt(10).cos,
1281+
equals(Decimal.fromDouble(-0.8390715290764524)));
1282+
expect(Decimal.fromInt(-10).cos,
1283+
equals(Decimal.fromDouble(-0.8390715290764524)));
1284+
});
1285+
12621286
test('square', () {
12631287
expect(Decimal.parse('0').square.toString(), equals('0.0'));
12641288
expect(Decimal.parse('1').square.toString(), equals('1.0'));

test/statistics_dynamic_int_test.dart

+24
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,30 @@ void main() {
12181218
equals('3.0'));
12191219
});
12201220

1221+
test('sin', () {
1222+
expect(DynamicInt.fromInt(1).sin,
1223+
equals(Decimal.fromDouble(0.8414709848078965)));
1224+
expect(DynamicInt.fromInt(-1).sin,
1225+
equals(Decimal.fromDouble(-0.8414709848078965)));
1226+
1227+
expect(DynamicInt.fromInt(10).sin,
1228+
equals(Decimal.fromDouble(-0.5440211108893699)));
1229+
expect(DynamicInt.fromInt(-10).sin,
1230+
equals(Decimal.fromDouble(0.5440211108893699)));
1231+
});
1232+
1233+
test('cos', () {
1234+
expect(DynamicInt.fromInt(1).cos,
1235+
equals(Decimal.fromDouble(0.5403023058681398)));
1236+
expect(DynamicInt.fromInt(-1).cos,
1237+
equals(Decimal.fromDouble(0.5403023058681398)));
1238+
1239+
expect(DynamicInt.fromInt(10).cos,
1240+
equals(Decimal.fromDouble(-0.8390715290764524)));
1241+
expect(DynamicInt.fromInt(-10).cos,
1242+
equals(Decimal.fromDouble(-0.8390715290764524)));
1243+
});
1244+
12211245
test('square', () {
12221246
expect(1.toDynamicInt().square.toString(), equals('1'));
12231247
expect(10.toDynamicInt().square.toString(), equals('100'));

0 commit comments

Comments
 (0)