Using NumberContext parameter in operations.

Compiling use clause with usage, rounding, precision
This commit is contained in:
Jindra Petřík
2024-08-10 20:49:28 +02:00
parent d25627460c
commit d4e0a1f6db
30 changed files with 605 additions and 355 deletions

View File

@@ -1,5 +1,7 @@
package mypkg
{
use decimal, rounding CEILING, precision 10;
public class MyClass
{
private var attr_dec:decimal;
@@ -7,11 +9,7 @@ package mypkg
public function test(arg_d:decimal): void
{
//Presision values: HALF_EVEN, DOWN, FLOOR, UP, CEILING, HALF_UP, HALF_DOWN
//use decimal, precision 20, rounding FLOOR;
use Number, precision 10;
//Presision values: HALF_EVEN, DOWN, FLOOR, UP, CEILING, HALF_UP, HALF_DOWN
var a:decimal = 10000000010000000002000000000300000000040000000005m;
var b:int = 10;
@@ -27,6 +25,9 @@ package mypkg
}
private function testd(arg_d:decimal) {
var a:* = 1;
var b:* = 2;
var c = a + b;
}
}