From 94d06c45af9cfcd5e8d5b73116c4eb22061cd115 Mon Sep 17 00:00:00 2001 From: Jesse Alama Date: Mon, 15 Apr 2024 16:32:45 +0200 Subject: [PATCH] Remove rounding mode option in remainder (#123) * Remove rounding mode option in remainder The precision of the result comes from the precision of the arguments. We do integer division until we get a clean result; any residue is the remainder. --- index.html | 66 +++++++++++++++++++++++++++--------------------------- spec.emu | 4 ++-- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/index.html b/index.html index ddeb086d..aae98600 100644 --- a/index.html +++ b/index.html @@ -1557,7 +1557,7 @@ }); let sdoMap = JSON.parse(`{}`); -let biblio = JSON.parse(`{"refsByClause":{"sec-decimal-intro":["_ref_0","_ref_1","_ref_2","_ref_3","_ref_4","_ref_50","_ref_51","_ref_52","_ref_53","_ref_54","_ref_55","_ref_56","_ref_57","_ref_58","_ref_59","_ref_60","_ref_61","_ref_62","_ref_63","_ref_64","_ref_65","_ref_66"],"sec-decimal.prototype.abs":["_ref_5","_ref_6","_ref_7","_ref_73"],"sec-decimal.prototype.neg":["_ref_8"],"sec-decimal.prototype.add":["_ref_9","_ref_10","_ref_11","_ref_12","_ref_13","_ref_14","_ref_15","_ref_16","_ref_74","_ref_75","_ref_76","_ref_77"],"sec-decimal.prototype.subtract":["_ref_17","_ref_18","_ref_19","_ref_20","_ref_21","_ref_22","_ref_23","_ref_24","_ref_78","_ref_79","_ref_80","_ref_81"],"sec-decimal.prototype.multiply":["_ref_25","_ref_26","_ref_27","_ref_28","_ref_29","_ref_30","_ref_31","_ref_82","_ref_83","_ref_84","_ref_85"],"sec-decimal.prototype.divide":["_ref_32","_ref_33","_ref_34","_ref_35","_ref_36","_ref_37","_ref_38","_ref_86","_ref_87","_ref_88","_ref_89"],"sec-decimal.prototype.remainder":["_ref_39","_ref_40","_ref_41","_ref_42","_ref_43","_ref_90","_ref_91","_ref_92"],"sec-decimal.prototype.equals":["_ref_44"],"sec-decimal.prototype.lessthan":["_ref_45"],"sec-decimal-method-round":["_ref_46","_ref_93"],"sec-decimal.prototype.tostring":["_ref_47","_ref_48","_ref_49"],"sec-decimal.prototype.isnan":["_ref_67","_ref_68"],"sec-decimal.prototype.isfinite":["_ref_69","_ref_70"],"sec-decimal.prototype.significand":["_ref_71"],"sec-decimal.prototype.exponent":["_ref_72"],"sec-copyright-and-software-license":["_ref_94"]},"entries":[{"type":"clause","id":"sec-scope","titleHTML":"Scope","number":"1"},{"type":"clause","id":"ref-ieee-754-2019","titleHTML":"IEEE 754-2019","number":"2.1","referencingIds":["_ref_0","_ref_1"]},{"type":"clause","id":"sec-normative-references","titleHTML":"Normative References","number":"2"},{"type":"term","term":"IEEE 754 Decimal128 value","id":"dfn-ieee-754-decimal128-value","referencingIds":["_ref_3","_ref_6","_ref_11","_ref_19","_ref_73","_ref_74","_ref_78","_ref_82","_ref_86","_ref_90"]},{"type":"term","term":"Decimal128 NaN","id":"dfn-decimal128-nan","referencingIds":["_ref_68","_ref_70"]},{"type":"term","term":"A","id":"dfn-map-from-ieee-754-decimal128","referencingIds":["_ref_7","_ref_12","_ref_20","_ref_27","_ref_34","_ref_41","_ref_52","_ref_54","_ref_55","_ref_56","_ref_57","_ref_61","_ref_63","_ref_67","_ref_69","_ref_71","_ref_72","_ref_94"]},{"type":"term","term":"B","id":"dfn-map-to-ieee-754-decimal128","referencingIds":["_ref_5","_ref_8","_ref_9","_ref_10","_ref_17","_ref_18","_ref_25","_ref_26","_ref_32","_ref_33","_ref_39","_ref_40","_ref_53"]},{"type":"term","term":"rounding mode","id":"dfn-rounding-mode","referencingIds":["_ref_13","_ref_15","_ref_16","_ref_21","_ref_23","_ref_24","_ref_28","_ref_30","_ref_31","_ref_35","_ref_37","_ref_38","_ref_42","_ref_46","_ref_77","_ref_81","_ref_85","_ref_89","_ref_93"]},{"type":"term","term":"default rounding mode","id":"dfn-default-rounding-mode","referencingIds":["_ref_14","_ref_22","_ref_29","_ref_36","_ref_43"]},{"type":"term","term":"digit","id":"dfn-digit","referencingIds":["_ref_50","_ref_51","_ref_75","_ref_76","_ref_79","_ref_80","_ref_83","_ref_84","_ref_87","_ref_88","_ref_91","_ref_92"]},{"type":"term","term":"decimal string","id":"dfn-decimal-string","referencingIds":["_ref_4","_ref_58","_ref_59"]},{"type":"term","term":"signed decimal string","id":"dfn-signed-decimal-string","referencingIds":["_ref_47","_ref_48"]},{"type":"term","term":"exponential string","id":"dfn-exponential-string","referencingIds":["_ref_62"]},{"type":"term","term":"signed exponential string","id":"dfn-signed-exponential-string","referencingIds":["_ref_49"]},{"type":"term","term":"mathematical value","id":"dfn-mathematical-value","referencingIds":["_ref_44","_ref_45","_ref_60"]},{"type":"term","term":"normal","id":"dfn-normal","referencingIds":["_ref_64","_ref_65","_ref_66"]},{"type":"clause","id":"sec-decimal-intro","titleHTML":"Introduction","number":""},{"type":"clause","id":"sec-the-decimal-constructor","titleHTML":"The Decimal128 Constructor","number":"3.1"},{"type":"clause","id":"sec-the-decimal-object","titleHTML":"The Decimal128 Object","number":"3"},{"type":"clause","id":"sec-decimal.prototype.isnan","titleHTML":"Decimal128.prototype.isNaN","number":"4.1","referencingIds":["_ref_2"]},{"type":"clause","id":"sec-decimal.prototype.isfinite","titleHTML":"Decimale128.prototype.isFinite","number":"4.2"},{"type":"clause","id":"sec-decimal.prototype.significand","titleHTML":"Decimale128.prototype.significand","number":"4.3"},{"type":"clause","id":"sec-decimal.prototype.exponent","titleHTML":"Decimale128.prototype.exponent","number":"4.4"},{"type":"clause","id":"sec-decimal.prototype.abs","titleHTML":"Decimal128.prototype.abs ( )","number":"4.5"},{"type":"clause","id":"sec-decimal.prototype.neg","titleHTML":"Decimal128.prototype.neg ( )","number":"4.6"},{"type":"clause","id":"sec-decimal.prototype.add","title":"Decimal128.prototype.add ( x [ , options ] )","titleHTML":"Decimal128.prototype.add ( x [ , options ] )","number":"4.7"},{"type":"clause","id":"sec-decimal.prototype.subtract","title":"Decimal128.prototype.subtract ( x [ , options ] )","titleHTML":"Decimal128.prototype.subtract ( x [ , options ] )","number":"4.8"},{"type":"clause","id":"sec-decimal.prototype.multiply","title":"Decimal128.prototype.multiply ( x [ , options ] )","titleHTML":"Decimal128.prototype.multiply ( x [ , options ] )","number":"4.9"},{"type":"clause","id":"sec-decimal.prototype.divide","title":"Decimal128.prototype.divide ( x [ , options ] )","titleHTML":"Decimal128.prototype.divide ( x [ , options ] )","number":"4.10"},{"type":"clause","id":"sec-decimal.prototype.remainder","title":"Decimal128.prototype.remainder ( x [ , options ] )","titleHTML":"Decimal128.prototype.remainder ( x [ , options ] )","number":"4.11"},{"type":"clause","id":"sec-decimal.prototype.equals","title":"Decimal128.prototype.equals ( x )","titleHTML":"Decimal128.prototype.equals ( x )","number":"4.12"},{"type":"clause","id":"sec-decimal.prototype.lessthan","title":"Decimal128.prototype.lessThan ( x )","titleHTML":"Decimal128.prototype.lessThan ( x )","number":"4.13"},{"type":"clause","id":"sec-decimal-method-round","title":"Decimal128.prototype.round ( numFractionalDigits [ , mode ] )","titleHTML":"Decimal128.prototype.round ( numFractionalDigits [ , mode ] )","number":"4.14"},{"type":"clause","id":"sec-decimal.prototype.tostring","title":"Decimal128.prototype.toString ( [ options ] )","titleHTML":"Decimal128.prototype.toString ( [ options ] )","number":"4.15"},{"type":"clause","id":"sec-decimal.prototype.valueof","title":"Decimal128.prototype.valueOf ( x )","titleHTML":"Decimal128.prototype.valueOf ( x )","number":"4.16"},{"type":"clause","id":"sec-decimal-prototype-properties","titleHTML":"Properties of the Decimal128 Prototype","number":"4"},{"type":"clause","id":"sec-copyright-and-software-license","title":"Copyright & Software License","titleHTML":"Copyright & Software License","number":"A"}]}`); +let biblio = JSON.parse(`{"refsByClause":{"sec-decimal-intro":["_ref_0","_ref_1","_ref_2","_ref_3","_ref_4","_ref_48","_ref_49","_ref_50","_ref_51","_ref_52","_ref_53","_ref_54","_ref_55","_ref_56","_ref_57","_ref_58","_ref_59","_ref_60","_ref_61","_ref_62","_ref_63","_ref_64"],"sec-decimal.prototype.abs":["_ref_5","_ref_6","_ref_7","_ref_71"],"sec-decimal.prototype.neg":["_ref_8"],"sec-decimal.prototype.add":["_ref_9","_ref_10","_ref_11","_ref_12","_ref_13","_ref_14","_ref_15","_ref_16","_ref_72","_ref_73","_ref_74","_ref_75"],"sec-decimal.prototype.subtract":["_ref_17","_ref_18","_ref_19","_ref_20","_ref_21","_ref_22","_ref_23","_ref_24","_ref_76","_ref_77","_ref_78","_ref_79"],"sec-decimal.prototype.multiply":["_ref_25","_ref_26","_ref_27","_ref_28","_ref_29","_ref_30","_ref_31","_ref_80","_ref_81","_ref_82","_ref_83"],"sec-decimal.prototype.divide":["_ref_32","_ref_33","_ref_34","_ref_35","_ref_36","_ref_37","_ref_38","_ref_84","_ref_85","_ref_86","_ref_87"],"sec-decimal.prototype.remainder":["_ref_39","_ref_40","_ref_41"],"sec-decimal.prototype.equals":["_ref_42"],"sec-decimal.prototype.lessthan":["_ref_43"],"sec-decimal-method-round":["_ref_44","_ref_88"],"sec-decimal.prototype.tostring":["_ref_45","_ref_46","_ref_47"],"sec-decimal.prototype.isnan":["_ref_65","_ref_66"],"sec-decimal.prototype.isfinite":["_ref_67","_ref_68"],"sec-decimal.prototype.significand":["_ref_69"],"sec-decimal.prototype.exponent":["_ref_70"],"sec-copyright-and-software-license":["_ref_89"]},"entries":[{"type":"clause","id":"sec-scope","titleHTML":"Scope","number":"1"},{"type":"clause","id":"ref-ieee-754-2019","titleHTML":"IEEE 754-2019","number":"2.1","referencingIds":["_ref_0","_ref_1"]},{"type":"clause","id":"sec-normative-references","titleHTML":"Normative References","number":"2"},{"type":"term","term":"IEEE 754 Decimal128 value","id":"dfn-ieee-754-decimal128-value","referencingIds":["_ref_3","_ref_6","_ref_11","_ref_19","_ref_71","_ref_72","_ref_76","_ref_80","_ref_84"]},{"type":"term","term":"Decimal128 NaN","id":"dfn-decimal128-nan","referencingIds":["_ref_66","_ref_68"]},{"type":"term","term":"A","id":"dfn-map-from-ieee-754-decimal128","referencingIds":["_ref_7","_ref_12","_ref_20","_ref_27","_ref_34","_ref_41","_ref_50","_ref_52","_ref_53","_ref_54","_ref_55","_ref_59","_ref_61","_ref_65","_ref_67","_ref_69","_ref_70","_ref_89"]},{"type":"term","term":"B","id":"dfn-map-to-ieee-754-decimal128","referencingIds":["_ref_5","_ref_8","_ref_9","_ref_10","_ref_17","_ref_18","_ref_25","_ref_26","_ref_32","_ref_33","_ref_39","_ref_40","_ref_51"]},{"type":"term","term":"rounding mode","id":"dfn-rounding-mode","referencingIds":["_ref_13","_ref_15","_ref_16","_ref_21","_ref_23","_ref_24","_ref_28","_ref_30","_ref_31","_ref_35","_ref_37","_ref_38","_ref_44","_ref_75","_ref_79","_ref_83","_ref_87","_ref_88"]},{"type":"term","term":"default rounding mode","id":"dfn-default-rounding-mode","referencingIds":["_ref_14","_ref_22","_ref_29","_ref_36"]},{"type":"term","term":"digit","id":"dfn-digit","referencingIds":["_ref_48","_ref_49","_ref_73","_ref_74","_ref_77","_ref_78","_ref_81","_ref_82","_ref_85","_ref_86"]},{"type":"term","term":"decimal string","id":"dfn-decimal-string","referencingIds":["_ref_4","_ref_56","_ref_57"]},{"type":"term","term":"signed decimal string","id":"dfn-signed-decimal-string","referencingIds":["_ref_45","_ref_46"]},{"type":"term","term":"exponential string","id":"dfn-exponential-string","referencingIds":["_ref_60"]},{"type":"term","term":"signed exponential string","id":"dfn-signed-exponential-string","referencingIds":["_ref_47"]},{"type":"term","term":"mathematical value","id":"dfn-mathematical-value","referencingIds":["_ref_42","_ref_43","_ref_58"]},{"type":"term","term":"normal","id":"dfn-normal","referencingIds":["_ref_62","_ref_63","_ref_64"]},{"type":"clause","id":"sec-decimal-intro","titleHTML":"Introduction","number":""},{"type":"clause","id":"sec-the-decimal-constructor","titleHTML":"The Decimal128 Constructor","number":"3.1"},{"type":"clause","id":"sec-the-decimal-object","titleHTML":"The Decimal128 Object","number":"3"},{"type":"clause","id":"sec-decimal.prototype.isnan","titleHTML":"Decimal128.prototype.isNaN","number":"4.1","referencingIds":["_ref_2"]},{"type":"clause","id":"sec-decimal.prototype.isfinite","titleHTML":"Decimale128.prototype.isFinite","number":"4.2"},{"type":"clause","id":"sec-decimal.prototype.significand","titleHTML":"Decimale128.prototype.significand","number":"4.3"},{"type":"clause","id":"sec-decimal.prototype.exponent","titleHTML":"Decimale128.prototype.exponent","number":"4.4"},{"type":"clause","id":"sec-decimal.prototype.abs","titleHTML":"Decimal128.prototype.abs ( )","number":"4.5"},{"type":"clause","id":"sec-decimal.prototype.neg","titleHTML":"Decimal128.prototype.neg ( )","number":"4.6"},{"type":"clause","id":"sec-decimal.prototype.add","title":"Decimal128.prototype.add ( x [ , options ] )","titleHTML":"Decimal128.prototype.add ( x [ , options ] )","number":"4.7"},{"type":"clause","id":"sec-decimal.prototype.subtract","title":"Decimal128.prototype.subtract ( x [ , options ] )","titleHTML":"Decimal128.prototype.subtract ( x [ , options ] )","number":"4.8"},{"type":"clause","id":"sec-decimal.prototype.multiply","title":"Decimal128.prototype.multiply ( x [ , options ] )","titleHTML":"Decimal128.prototype.multiply ( x [ , options ] )","number":"4.9"},{"type":"clause","id":"sec-decimal.prototype.divide","title":"Decimal128.prototype.divide ( x [ , options ] )","titleHTML":"Decimal128.prototype.divide ( x [ , options ] )","number":"4.10"},{"type":"clause","id":"sec-decimal.prototype.remainder","title":"Decimal128.prototype.remainder ( x )","titleHTML":"Decimal128.prototype.remainder ( x )","number":"4.11"},{"type":"clause","id":"sec-decimal.prototype.equals","title":"Decimal128.prototype.equals ( x )","titleHTML":"Decimal128.prototype.equals ( x )","number":"4.12"},{"type":"clause","id":"sec-decimal.prototype.lessthan","title":"Decimal128.prototype.lessThan ( x )","titleHTML":"Decimal128.prototype.lessThan ( x )","number":"4.13"},{"type":"clause","id":"sec-decimal-method-round","title":"Decimal128.prototype.round ( numFractionalDigits [ , mode ] )","titleHTML":"Decimal128.prototype.round ( numFractionalDigits [ , mode ] )","number":"4.14"},{"type":"clause","id":"sec-decimal.prototype.tostring","title":"Decimal128.prototype.toString ( [ options ] )","titleHTML":"Decimal128.prototype.toString ( [ options ] )","number":"4.15"},{"type":"clause","id":"sec-decimal.prototype.valueof","title":"Decimal128.prototype.valueOf ( x )","titleHTML":"Decimal128.prototype.valueOf ( x )","number":"4.16"},{"type":"clause","id":"sec-decimal-prototype-properties","titleHTML":"Properties of the Decimal128 Prototype","number":"4"},{"type":"clause","id":"sec-copyright-and-software-license","title":"Copyright & Software License","titleHTML":"Copyright & Software License","number":"A"}]}`); ;let usesMultipage = false