10
10
// / @parblock
11
11
// /
12
12
// / Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
13
- // / Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
13
+ // / Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd.
14
14
// /
15
15
// / POV-Ray is free software: you can redistribute it and/or modify
16
16
// / it under the terms of the GNU Affero General Public License as
@@ -401,14 +401,14 @@ static constexpr POV_INT64 CX_IPOW(POV_INT64 base, int exp, POV_INT64 result) {
401
401
// / * solve_quadratic()
402
402
// /
403
403
// / @note
404
- // / The setting is used to set internal 'constextr int PRECISE_DIG ' and
405
- // / 'constexpr DBL PRECISE_EPSILON ' typed values.
404
+ // / The setting is used to set internal 'constextr int gkPrecise_dig ' and
405
+ // / 'constexpr DBL gkPrecise_epsilon ' typed values.
406
406
// /
407
407
// / @note
408
408
// / If @ref PRECISE_FLOAT is set to 'float', 'double' or 'long double', the C++11 standard
409
409
// / itself defines via cfloat include the macros: FLT_DIG, DBL_DIG, LDBL_DIG, FLT_EPSILON,
410
- // / DBL_EPSILON, LDBL_EPSILON. These macro values are used to set PRECISE_DIG and
411
- // / PRECISE_EPSILON values via the C++ constexpr mechanism.
410
+ // / DBL_EPSILON, LDBL_EPSILON. These macro values are used to set gkPrecise_dig and
411
+ // / gkPrecise_epsilon values via the C++ constexpr mechanism.
412
412
// /
413
413
// / @attention
414
414
// / Math with data types not run in hardware or with awkward bit sizes with
@@ -463,32 +463,33 @@ static constexpr POV_INT64 CX_IPOW(POV_INT64 base, int exp, POV_INT64 result) {
463
463
#define PRECISE_EPSLN 1.92592994438724e-34
464
464
#endif
465
465
466
- // / @var PRECISE_FLT
466
+ // / @var gkPrecise_flt
467
467
// / A 'constexpr int' 0 when @ref PRECISE_FLOAT resolves to float type or !=0 otherwise.
468
468
// /
469
- // / @var PRECISE_DBL
469
+ // / @var gkPrecise_dbl
470
470
// / A 'constexpr int' 0 when @ref PRECISE_FLOAT resolves to double type or !=0 otherwise.
471
471
// /
472
- // / @var PRECISE_LDBL
472
+ // / @var gkPrecise_ldbl
473
473
// / A 'constexpr int' 0 when @ref PRECISE_FLOAT resolves to long double type or !=0 otherwise.
474
474
// /
475
- // / @var PRECISE_DIG
475
+ // / @var gkPrecise_dig
476
476
// / A 'constexpr int' maximum decimal digits given @ref PRECISE_FLOAT.
477
477
// /
478
478
// / Set to C+11 standard value where defined and to @ref PRECISE_DIGITS otherwise.
479
479
// /
480
- constexpr int PRECISE_FLT = CX_STRCMP(CX_XSTR(PRECISE_FLOAT), " float" );
481
- constexpr int PRECISE_DBL = CX_STRCMP(CX_XSTR(PRECISE_FLOAT), " double" );
482
- constexpr int PRECISE_LDBL = CX_STRCMP(CX_XSTR(PRECISE_FLOAT), " long double" );
480
+ constexpr int gkPrecise_flt = CX_STRCMP(CX_XSTR(PRECISE_FLOAT), " float" );
481
+ constexpr int gkPrecise_dbl = CX_STRCMP(CX_XSTR(PRECISE_FLOAT), " double" );
482
+ constexpr int gkPrecise_ldbl = CX_STRCMP(CX_XSTR(PRECISE_FLOAT), " long double" );
483
483
484
- constexpr int PRECISE_DIG = PRECISE_FLT ?
485
- PRECISE_DBL ?
486
- PRECISE_LDBL ? PRECISE_DIGITS
487
- : LDBL_DIG
488
- : DBL_DIG
489
- : FLT_DIG;
484
+ constexpr int gkPrecise_dig =
485
+ gkPrecise_flt ?
486
+ gkPrecise_dbl ?
487
+ gkPrecise_ldbl ? PRECISE_DIGITS
488
+ : LDBL_DIG
489
+ : DBL_DIG
490
+ : FLT_DIG;
490
491
491
- // / @var PRECISE_EPSILON
492
+ // / @var gkPrecise_epsilon
492
493
// / A 'constexpr DBL' value for minimum epsilon step given @ref PRECISE_FLOAT.
493
494
// /
494
495
// / Set to C+11 standard value*2.0 where defined and to @ref PRECISE_EPSLN*2.0 otherwise.
@@ -497,38 +498,40 @@ constexpr int PRECISE_DIG = PRECISE_FLT ?
497
498
// / Using 2.0 multiplier due maths calculating coefficients for higher order polynomials
498
499
// / introducing more than single bit/step error in practice.
499
500
// /
500
- constexpr DBL PRECISE_EPSILON = PRECISE_FLT ?
501
- PRECISE_DBL ?
502
- PRECISE_LDBL ? PRECISE_EPSLN*2.0
503
- : LDBL_EPSILON*2.0
504
- : DBL_EPSILON*2.0
505
- : FLT_EPSILON*2.0 ;
501
+ constexpr DBL gkPrecise_epsilon =
502
+ gkPrecise_flt ?
503
+ gkPrecise_dbl ?
504
+ gkPrecise_ldbl ? PRECISE_EPSLN*2.0
505
+ : LDBL_EPSILON*2.0
506
+ : DBL_EPSILON*2.0
507
+ : FLT_EPSILON*2.0 ;
506
508
507
- // / @var POV_DBL_IS_FLT
509
+ // / @var gkDBL_is_flt
508
510
// / A 'constexpr int' 0 when @ref DBL resolves to float type or !=0 otherwise.
509
511
// /
510
- // / @var POV_DBL_IS_DBL
512
+ // / @var gkDBL_is_dbl
511
513
// / A 'constexpr int' 0 when @ref DBL resolves to double type or !=0 otherwise.
512
514
// /
513
- // / @var POV_DBL_IS_LDBL
515
+ // / @var gkDBL_is_ldbl
514
516
// / A 'constexpr int' 0 when @ref DBL resolves to long double type or !=0 otherwise.
515
517
// /
516
- // / @var POV_DBL_DIG
518
+ // / @var gkDBL_dig
517
519
// / A 'constexpr int' value for maximum decimal digits for given @ref DBL.
518
520
// /
519
521
// / Set to C+11 standard value where defined and to @ref PRECISE_DIGITS otherwise.
520
522
// /
521
- constexpr int POV_DBL_IS_FLT = CX_STRCMP(CX_XSTR(DBL), " float" );
522
- constexpr int POV_DBL_IS_DBL = CX_STRCMP(CX_XSTR(DBL), " double" );
523
- constexpr int POV_DBL_IS_LDBL = CX_STRCMP(CX_XSTR(DBL), " long double" );
524
- constexpr int POV_DBL_DIG = POV_DBL_IS_FLT ?
525
- POV_DBL_IS_DBL ?
526
- POV_DBL_IS_LDBL ? PRECISE_DIGITS
527
- : LDBL_DIG
528
- : DBL_DIG
529
- : FLT_DIG;
530
-
531
- // / @var POV_DBL_EPSILON
523
+ constexpr int gkDBL_is_flt = CX_STRCMP(CX_XSTR(DBL), " float" );
524
+ constexpr int gkDBL_is_dbl = CX_STRCMP(CX_XSTR(DBL), " double" );
525
+ constexpr int gkDBL_is_ldbl = CX_STRCMP(CX_XSTR(DBL), " long double" );
526
+ constexpr int gkDBL_dig =
527
+ gkDBL_is_flt ?
528
+ gkDBL_is_dbl ?
529
+ gkDBL_is_ldbl ? PRECISE_DIGITS
530
+ : LDBL_DIG
531
+ : DBL_DIG
532
+ : FLT_DIG;
533
+
534
+ // / @var gkDBL_epsilon
532
535
// / A 'constexpr DBL' value for minimum epsilon step for given POV-Ray's @ref DBL.
533
536
// /
534
537
// / Set to C+11 standard value*2.0 where defined and to @ref PRECISE_EPSLN*2.0 otherwise.
@@ -541,24 +544,25 @@ constexpr int POV_DBL_DIG = POV_DBL_IS_FLT ?
541
544
// / Using 2.0 multiplier due maths calculating coefficients for higher order polynomials
542
545
// / introducing more than single bit/step error in practice.
543
546
// /
544
- constexpr DBL POV_DBL_EPSILON = POV_DBL_IS_FLT ?
545
- POV_DBL_IS_DBL ?
546
- POV_DBL_IS_LDBL ? PRECISE_EPSLN*2.0
547
- : LDBL_EPSILON*2.0
548
- : DBL_EPSILON*2.0
549
- : FLT_EPSILON*2.0 ;
547
+ constexpr DBL gkDBL_epsilon =
548
+ gkDBL_is_flt ?
549
+ gkDBL_is_dbl ?
550
+ gkDBL_is_ldbl ? PRECISE_EPSLN*2.0
551
+ : LDBL_EPSILON*2.0
552
+ : DBL_EPSILON*2.0
553
+ : FLT_EPSILON*2.0 ;
550
554
551
555
552
- // / @var MIN_ISECT_DEPTH_RETURNED
556
+ // / @var gkMinIsectDepthReturned
553
557
// / A 'constexpr DBL' value below which roots from primitive objects are not returned.
554
558
// /
555
559
// / The value will track @ref DBL float type and is very roughly the square root
556
- // / of the determined POV_DBL_EPSILON . The plan is to migrate base shapes to
560
+ // / of the determined gkDBL_epsilon . The plan is to migrate base shapes to
557
561
// / this single value instead of the many different thresholds used today.
558
562
// / Aiming for both more accuracy and something which automatically adjust to
559
563
// / the DBL type used.
560
564
// /
561
- constexpr DBL MIN_ISECT_DEPTH_RETURNED = POV_DBL_EPSILON *(DBL)CX_IPOW(10 ,POV_DBL_DIG /2 +1 );
565
+ constexpr DBL gkMinIsectDepthReturned = gkDBL_epsilon *(DBL)CX_IPOW(10 ,gkDBL_dig /2 +1 );
562
566
563
567
// / @}
564
568
// /
0 commit comments