@@ -3483,7 +3483,9 @@ Trigonometric Functions: ''sin()'', ''cos()'', ''tan()'', ''asin()'', ''acos()''
3483
3483
(That is, ''sin(45deg)'' , ''sin(.125turn)'' , and ''sin(3.14159 / 4)''
3484
3484
all represent the same value,
3485
3485
approximately ''.707'' .)
3486
- They all represent a <<number>> ;
3486
+ They all represent a <<number>> ,
3487
+ with the return type [=made consistent=]
3488
+ with the input [=calculation’s=] type.
3487
3489
''sin()'' and ''cos()'' will always return a number between −1 and 1,
3488
3490
while ''tan()'' can return any number between −∞ and +∞.
3489
3491
(See [[#calc-type-checking]] for details on how [=math functions=] handle ∞.)
@@ -3495,7 +3497,9 @@ Trigonometric Functions: ''sin()'', ''cos()'', ''tan()'', ''asin()'', ''acos()''
3495
3497
which must resolve to a <<number>> ,
3496
3498
and compute their corresponding function,
3497
3499
interpreting their result as a number of radians,
3498
- representing an <<angle>> .
3500
+ representing an <<angle>>
3501
+ with the return type [=made consistent=]
3502
+ with the input [=calculation’s=] type.
3499
3503
The angle returned by ''asin()'' must be normalized to the range [''-90deg'', ''90deg''] ;
3500
3504
the angle returned by ''acos()'' to the range [''0deg'', ''180deg''] ;
3501
3505
and the angle returned by ''atan()'' to the range [''-90deg'', ''90deg''] .
@@ -3506,7 +3510,9 @@ Trigonometric Functions: ''sin()'', ''cos()'', ''tan()'', ''asin()'', ''acos()''
3506
3510
but must have a [=consistent type=]
3507
3511
or else the function is invalid.
3508
3512
The function returns the <<angle>>
3509
- between the positive X-axis and the point (B,A).
3513
+ between the positive X-axis and the point (B,A),
3514
+ with the return type [=made consistent=]
3515
+ with the input [=calculation’s=] type.
3510
3516
The returned angle must be normalized to the interval (''-180deg'' , ''180deg'' ]
3511
3517
(that is, greater than ''-180deg'' , and less than or equal to ''180deg'' ).
3512
3518
@@ -3688,12 +3694,18 @@ Exponential Functions: ''pow()'', ''sqrt()'', ''hypot()'', ''log()'', ''exp()''
3688
3694
both of which must resolve to <<number>> s,
3689
3695
and returns the result of raising A to the power of B,
3690
3696
returning the value as a <<number>> .
3697
+ The input [=calculations=]
3698
+ must have a [=consistent type=]
3699
+ or else the function is invalid;
3700
+ the result's type will be the [=consistent type=] .
3691
3701
3692
3702
The <dfn lt="sqrt()">sqrt(A)</dfn> function
3693
3703
contains a single [=calculation=]
3694
3704
which must resolve to a <<number>> ,
3695
3705
and returns the square root of the value
3696
- as a <<number>> .
3706
+ as a <<number>> ,
3707
+ with the return type [=made consistent=]
3708
+ with the input [=calculation’s=] type.
3697
3709
(''sqrt(X)'' and ''pow(X, .5)'' are basically equivalent,
3698
3710
differing only in some error-handling;
3699
3711
''sqrt()'' is a common enough function
@@ -4023,6 +4035,9 @@ Sign-Related Functions: ''abs()'', ''sign()''</h3>
4023
4035
+1 if A's numeric value is positive,
4024
4036
0⁺ if A's numeric value is 0⁺,
4025
4037
and 0⁻ if A's numeric value is 0⁻.
4038
+ The return type is a <<number>> ,
4039
+ [=made consistent=]
4040
+ with the input [=calculation’s=] type.
4026
4041
4027
4042
Note: Both of these functions operate on the fully simplified/resolved form of their arguments,
4028
4043
which may give unintuitive results at first glance.
@@ -4322,11 +4337,24 @@ Type Checking</h3>
4322
4337
</div>
4323
4338
4324
4339
<div algorithm>
4325
- Two or more calculations have a <dfn export local-lt="consistent">consistent type</dfn>
4340
+ Two or more calculations have a <dfn export for=CSS local-lt="consistent">consistent type</dfn>
4326
4341
if [=add two types/adding the types=] doesn't result in failure.
4327
4342
The [=consistent type=] is the result of the type addition.
4328
4343
</div>
4329
4344
4345
+ <div algorithm>
4346
+ To <dfn export for=CSS lt="make a type consistent|make consistent|made consistent">make a type |base| consistent</dfn>
4347
+ with another type |input|:
4348
+
4349
+ 1. If both |base| and |input| have different non-null [=percent hints=] ,
4350
+ they can't be made consistent.
4351
+ Return failure.
4352
+
4353
+ 2. Otherwise, set |base|’s [=percent hint=]
4354
+ to |input|’s [=percent hint=] ,
4355
+ and return |base|.
4356
+ </div>
4357
+
4330
4358
[=Math functions=] themselves have [=CSSNumericValue/types=] ,
4331
4359
according to their contained [=calculations=] :
4332
4360
0 commit comments