This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 6a2f742073 fix: Correct CONVERT atm and Torr factors to ODF 1.4 Table 
24
6a2f742073 is described below

commit 6a2f74207300e1eb0c86da8d2294d74c5e8a77cb
Author: Pedro Giffuni <[email protected]>
AuthorDate: Mon Nov 16 15:36:26 2026 -0500

    fix: Correct CONVERT atm and Torr factors to ODF 1.4 Table 24
    
    Correct atmospheric pressure conversion factors in Calc's CONVERT
    implementation (Analysis add-in) to match ODF 1.4 Part 4, Section 6.16.18,
    Table 24:
    
    - atm: 1 atm = 101325.1 Pa (factor was 9.8692329999819300E-06, now
      9.86922292699439618E-06 = 1/101325.1)
    - Torr: 1 Torr = 101325/760 Pa exactly (factor was
      7.5006380000000000E-03, now 7.50061682704169716E-03 = 760/101325)
    - SI_at: unchanged at 1.0197162129779282E-05 = 1/98066.5 (correct to 1 ULP)
    
    The table stores reciprocal base-unit factors (1 Pa = X units), so the
    conversion algorithm result = input * dest_factor / source_factor remains
    unchanged.
    
    Added 6 regression test cases covering both conversion directions for all
    three units plus cross-conversions (atm->Torr, SI_at->atm, Torr->SI_at).
---
 main/scaddins/source/analysis/analysishelper.cxx | 8 ++++----
 test/odf-validate/calcval-cases14.tsv            | 6 ++++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/main/scaddins/source/analysis/analysishelper.cxx 
b/main/scaddins/source/analysis/analysishelper.cxx
index fce84bb8a1..840a4b5dd2 100644
--- a/main/scaddins/source/analysis/analysishelper.cxx
+++ b/main/scaddins/source/analysis/analysishelper.cxx
@@ -2450,11 +2450,11 @@ ConvertDataList::ConvertDataList( void )
 
     // PRESSURE: 1 Pascal is...
     NEWDP( "Pa",    1.0000000000000000E00,  CDC_Pressure ); // Pascal
-    NEWDP( "atm",   9.8692329999819300E-06, CDC_Pressure ); // Atmosphere
-    NEWDP( "at",    9.8692329999819300E-06, CDC_Pressure ); // Atmosphere also
-    NEWDP( "SI_at", 1.0197162129779282E-05, CDC_Pressure ); // Technical 
atmosphere (ODF 1.4)
+    NEWDP( "atm",   9.86922292699439618E-06, CDC_Pressure ); // Atmosphere   1 
atm = 101325.1 Pa (ODF 1.4 Table 24)
+    NEWDP( "at",    9.8692329999819300E-06, CDC_Pressure ); // Atmosphere also 
(deprecated)
+    NEWDP( "SI_at", 1.0197162129779282E-05, CDC_Pressure ); // Technical 
atmosphere (ODF 1.4) 1 SI_at = 98066.5 Pa
     NEWDP( "mmHg",  7.5006170799862700E-03, CDC_Pressure ); // mm Hg (Mercury)
-    NEWD( "Torr",   7.5006380000000000E-03, CDC_Pressure ); // *** Torr
+    NEWD( "Torr",   7.50061682704169716E-03, CDC_Pressure ); // Torr 1 Torr = 
101325/760 Pa exactly (ODF 1.4 Table 24)
     NEWD( "psi",    1.4503770000000000E-04, CDC_Pressure ); // *** Psi
 
     // FORCE: 1 Newton is...
diff --git a/test/odf-validate/calcval-cases14.tsv 
b/test/odf-validate/calcval-cases14.tsv
index aa84c89f14..15f93aa7c1 100644
--- a/test/odf-validate/calcval-cases14.tsv
+++ b/test/odf-validate/calcval-cases14.tsv
@@ -86,6 +86,12 @@ CONVERT.cm2.m2       =CONVERT(1;"cm2";"m2")  cell    0.0001  
6.16.18 Table 25: centi prefix
 CONVERT.Kibyte.bit     =CONVERT(1;"Kibyte";"bit")      cell    8192    6.16.18 
Table 26: kibi prefix on byte to bit
 CONVERT.km.Pa  =CONVERT(1;"km";"Pa")   cell    #ERR    invalid conversion: 
different unit groups
 CONVERT.ATM.Pa =CONVERT(1;"ATM";"Pa")  cell    #ERR    invalid conversion: 
case-sensitive unit names
+CONVERT.Pa.atm =CONVERT(101325.1;"Pa";"atm")   cell    1       6.16.18 Table 
24: Pa to standard atmosphere round-trip
+CONVERT.Pa.SI_at       =CONVERT(98066.5;"Pa";"SI_at")  cell    1       6.16.18 
Table 24: Pa to technical atmosphere round-trip
+CONVERT.Pa.Torr        =CONVERT(133.32236842105263;"Pa";"Torr")        cell    
1       6.16.18 Table 24: Pa to Torr round-trip
+CONVERT.atm.Torr       =CONVERT(1;"atm";"Torr")        cell    
760.0007500616828       6.16.18 Table 24: atm to Torr cross-conversion
+CONVERT.SI_at.atm      =CONVERT(1;"SI_at";"atm")       cell    
0.9678401501700961      6.16.18 Table 24: SI_at to atm cross-conversion
+CONVERT.Torr.SI_at     =CONVERT(1;"Torr";"SI_at")      cell    
0.001359509806315639    6.16.18 Table 24: Torr to SI_at cross-conversion
 EASTER.mid     =EASTERSUNDAY(1000)     cell    #ERR    6.10.8 constraint 1583 
<= Year (100 to 1582)
 EASTER.neg     =EASTERSUNDAY(-1)       cell    #ERR    6.10.8 constraint 1583 
<= Year (negative years used to wrap)
 EASTER.wrap    =EASTERSUNDAY(67536)    cell    #ERR    6.10.8 constraint Year 
<= 9956 (67536 used to wrap to 2000)

Reply via email to