guest271314 (2019-03-10T16:26:05.000Z)
guest271314 at gmail.com (2019-03-10T17:07:31.706Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. > But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Since the graph of using only the indexes of an array or string represented as a whole number and being a multiple of 9 is not linear (tl;dr How to improve efficiency of algorithm which generates next lexicographic permutation? https://stackoverflow.com/q/43290467) // graph 1 0,9,81 // graph 2 abc 012 0 acb 021 1 9 bac 102 2 81 bca 120 3 18 cab 201 4 81 cba 210 5 9 /\/\ / \ finding the mathematical relationship between discrete permutations (as a whole number) requires graphing multiple decimal numbers in attempt to *find* an *approximate* numeric relationship between the numbers (e.g., the below was done by hand) ~~(128.625*9*1.074) // 1243 ~~(128.625*9*1.144) // 1324 which can be described as *fuzzy-logic* graphing. In an array format the graphs can be finely tuned to adjust both 128.625 and 1.074 through and beyond 1.144 in parallel, or, for example, using several generator functions which maps the approximations closest to the criteria needed to get the precise multiple of 9 to get the *n*th permutation. With input "abcd" the procedure *can* be done by hand, with input of "abcdefghi" or >9 elements or digits (see 9erilous 9ermutations https://codegolf.stackexchange.com/q/175693) > This pattern always holds, even when you start using more that 10 numbers, though the length of the sequence is 𝑛!−1 for 𝑛 numbers. Note that to use numbers above 0 to 9, we don't change to a different base, we just multiply the number by 10𝑥, e.g. [1,12,11]10=1∗102+12∗101+11∗100=231. of input (the value is ignored) the array format is much simpler, to keep track of, or graph the trial and error. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new* proposal, most of the work has already been done. Alternatively, Intl.NumberFormat can be extended or adjusted to return numbers in an array instead of strings; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign") .map(({type, value}) => // ideally conversion to String then back to Number should not be necessary in JavaScript ("cost" of calculating .length of a String) ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message? The use of Math.trunc and remainder operator are getters, if the code portion of this proposal is reached, beyond standardization of the naming of getting certain portions of integers and arrays, developers should be able to use the same or similar methods to get *and* set the value of any digit of the integer or decimal, not only get the value. Conversion of integer or decimal to array and array to integer or decimal allows developers to *get* **and** *set* any index or element of the array, which then can be converted back to a number comprising all of its parts - without conversion to String during the procedure.
guest271314 at gmail.com (2019-03-10T17:05:00.922Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. > But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Since the graph of using only the indexes of an array or string represented as a whole number and being a multiple of 9 is not linear (tl;dr How to improve efficiency of algorithm which generates next lexicographic permutation? https://stackoverflow.com/q/43290467) // graph 1 0,9,81 // graph 2 abc 012 0 acb 021 1 9 bac 102 2 81 bca 120 3 18 cab 201 4 81 cba 210 5 9 /\/\ / \ finding the mathematical relationship between discrete permutations (as a whole number) requires graphing multiple decimal numbers in attempt to *find* an *approximate* numeric relationship between the numbers (e.g., the below was done by hand) ~~(128.625*9*1.074) // 1243 ~~(128.625*9*1.144) // 1324 which is akin to fuzzy-logic graphing. In an array format the graphs can be finely tuned to adjust both 128.625 and 1.074 through and beyond 1.144 in parallel, or, for example, using several generator functions which maps the approximations closest to the criteria needed to get the precise multiple of 9 to get the *n*th permutation. With input "abcd" the procedure *can* be done by hand, with input of "abcdefghi" or >9 elements or digits (see 9erilous 9ermutations https://codegolf.stackexchange.com/q/175693) > This pattern always holds, even when you start using more that 10 numbers, though the length of the sequence is 𝑛!−1 for 𝑛 numbers. Note that to use numbers above 0 to 9, we don't change to a different base, we just multiply the number by 10𝑥, e.g. [1,12,11]10=1∗102+12∗101+11∗100=231. of input (the value is ignored) the array format is much simpler, to keep track of, or graph the trial and error. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new* proposal, most of the work has already been done. Alternatively, Intl.NumberFormat can be extended or adjusted to return numbers in an array instead of strings; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign") .map(({type, value}) => // ideally conversion to String then back to Number should not be necessary in JavaScript ("cost" of calculating .length of a String) ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message? The use of Math.trunc and remainder operator are getters, if the code portion of this proposal is reached, beyond standardization of the naming of getting certain portions of integers and arrays, developers should be able to use the same or similar methods to get *and* set the value of any digit of the integer or decimal, not only get the value. Conversion of integer or decimal to array and array to integer or decimal allows developers to *get* **and** *set* any index or element of the array, which then can be converted back to a number comprising all of its parts - without conversion to String during the procedure.
guest271314 at gmail.com (2019-03-10T17:01:32.260Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. > But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Since the graph of using only the indexes of an array or string represented as a whole number and being a multiple of 9 is not linear (tl;dr How to improve efficiency of algorithm which generates next lexicographic permutation? https://stackoverflow.com/q/43290467) // graph 1 0,9,81 // graph 2 abc 012 0 acb 021 1 9 bac 102 2 81 bca 120 3 18 cab 201 4 81 cba 210 5 9 /\/\ / \ finding the mathematical relationship between discrete permutations (as a whole number) requires graphing multiple decimal numbers in attempt to *find* an *approximate* numeric relationship between the numbers (e.g., the below was done by hand) ~~(128.625*9*1.074) // 1243 ~~(128.625*9*1.144) // 1324 which is akin to fuzzy-logic graphing. In an array format the graphs can be finely tuned to adjust both 128.625 and 1.074 through and beyond 1.144 in parallel, or, for example, using several generator functions which maps the approximations closest to the criteria needed to get the precise multiple of 9 to get the *n*th permutation. With input "abcd" the procedure *can* be done by hand, with input of "abcdefghi" or >9 elements or digits of input (the value is ignored) the array format is much simpler, to keep track of, or graph the trial and error. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new* proposal, most of the work has already been done. Alternatively, Intl.NumberFormat can be extended or adjusted to return numbers in an array instead of strings; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign") .map(({type, value}) => // ideally conversion to String then back to Number should not be necessary in JavaScript ("cost" of calculating .length of a String) ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message? The use of Math.trunc and remainder operator are getters, if the code portion of this proposal is reached, beyond standardization of the naming of getting certain portions of integers and arrays, developers should be able to use the same or similar methods to get *and* set the value of any digit of the integer or decimal, not only get the value. Conversion of integer or decimal to array and array to integer or decimal allows developers to *get* **and** *set* any index or element of the array, which then can be converted back to a number comprising all of its parts - without conversion to String during the procedure.
guest271314 at gmail.com (2019-03-10T17:00:58.244Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. > But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Since the graph of using only the indexes of an array or string represented as a whole number and being a multiple of 9 is not linear (tl;dr https://stackoverflow.com/q/43290467) // graph 1 0,9,81 // graph 2 abc 012 0 acb 021 1 9 bac 102 2 81 bca 120 3 18 cab 201 4 81 cba 210 5 9 /\/\ / \ finding the mathematical relationship between discrete permutations (as a whole number) requires graphing multiple decimal numbers in attempt to *find* an *approximate* numeric relationship between the numbers (e.g., the below was done by hand) ~~(128.625*9*1.074) // 1243 ~~(128.625*9*1.144) // 1324 which is akin to fuzzy-logic graphing. In an array format the graphs can be finely tuned to adjust both 128.625 and 1.074 through and beyond 1.144 in parallel, or, for example, using several generator functions which maps the approximations closest to the criteria needed to get the precise multiple of 9 to get the *n*th permutation. With input "abcd" the procedure *can* be done by hand, with input of "abcdefghi" or >9 elements or digits of input (the value is ignored) the array format is much simpler, to keep track of, or graph the trial and error. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new* proposal, most of the work has already been done. Alternatively, Intl.NumberFormat can be extended or adjusted to return numbers in an array instead of strings; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign") .map(({type, value}) => // ideally conversion to String then back to Number should not be necessary in JavaScript ("cost" of calculating .length of a String) ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message? The use of Math.trunc and remainder operator are getters, if the code portion of this proposal is reached, beyond standardization of the naming of getting certain portions of integers and arrays, developers should be able to use the same or similar methods to get *and* set the value of any digit of the integer or decimal, not only get the value. Conversion of integer or decimal to array and array to integer or decimal allows developers to *get* **and** *set* any index or element of the array, which then can be converted back to a number comprising all of its parts - without conversion to String during the procedure.
guest271314 at gmail.com (2019-03-10T16:47:32.365Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. > But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new* proposal, most of the work has already been done. Alternatively, Intl.NumberFormat can be extended or adjusted to return numbers in an array instead of strings; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign") .map(({type, value}) => // ideally conversion to String then back to Number should not be necessary in JavaScript ("cost" of calculating .length of a String) ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message? The use of Math.trunc and remainder operator are getters, if the code portion of this proposal is reached, beyond standardization of the naming of getting certain portions of integers and arrays, developers should be able to use the same or similar methods to get *and* set the value of any digit of the integer or decimal, not only get the value. Conversion of integer or decimal to array and array to integer or decimal allows developers to *get* **and** *set* any index or element of the array, which then can be converted back to a number comprising all of its parts - without conversion to String during the procedure.
guest271314 at gmail.com (2019-03-10T16:42:27.902Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. > But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new* proposal, most of the work has already been done. Alternatively, Intl.NumberFormat can be extended or adjusted to return numbers in an array instead of strings; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign") .map(({type, value}) => ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message? The use of Math.trunc and remainder operator are getters, if the code portion of this proposal is reached, beyond standardization of the naming of getting certain portions of integers and arrays, developers should be able to use the same or similar methods to get *and* set the value of any digit of the integer or decimal, not only get the value. Conversion of integer or decimal to array and array to integer or decimal allows developers to *get* **and** *set* any index or element of the array, which then can be converted back to a number comprising all of its parts - without conversion to String during the procedure.
guest271314 at gmail.com (2019-03-10T16:39:56.346Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. > But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new* proposal, most of the work has already been done. Alternatively, Intl.NumberFormat can be extended or adjusted to return numbers in an array instead of strings; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign") .map(({type, value}) => ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message? The use of Math.trunc and remainder operator are getters, if the code portion of this proposal is reached, beyond standardization of the naming of getting certain portions of integers and arrays, developers should be able to use the same or similar methods to get *and* set the value of any digit of the integer or decimal, not only get the value.
guest271314 at gmail.com (2019-03-10T16:32:10.761Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. > But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new* proposal, most of the work has already been done. Alternatively, Intl.NumberFormat can be extended or adjusted to return numbers in an array instead of strings; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign") .map(({type, value}) => ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message?
guest271314 at gmail.com (2019-03-10T16:31:29.482Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. > But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new* proposal, most of the work has already been done. Alternatively, Intl.NumberFormat can be extended; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign") .map(({type, value}) => ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message?
guest271314 at gmail.com (2019-03-10T16:29:59.974Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. > But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new *proposal, Intl.NumberFormate can be extended; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign") .map(({type, value}) => ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message?
guest271314 at gmail.com (2019-03-10T16:28:44.746Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. > But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new *proposal, Intl.NumberFormate can be extended; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign").map(({type, value}) => ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message?
guest271314 at gmail.com (2019-03-10T16:28:20.072Z)
> (If you really wanted this as an integer, it's not well-founded; .567 > isn't exactly representable as a double, so JS doesn't know that you > "meant" it to have only three digits after the decimal point, and thus > want 567 as the answer. You'll instead get some very very large > integer that *starts with* 567, followed by a bunch of zeros, followed > by some randomish digits at the end.) The code at the first post solves that problem. But the question is still "what would someone use this information for?" That question has been answered several times in the posts above. This users' motivation was and is the ability to manipulate JavaScript floating-point numbers (which could be considered "broken", as you described above) in order to solve mathematical problems (in this case, directly calculating the *n*th lexicographic permutation) with the number or decimal being represented as an array, without having to be concerned with not getting the same value when the array is converted back to a number. Felipe Nascimento de Moura mentioned several other applications. The work has already been done. This proposal is essentially to standardize the naming conventions. Whether a Number method is used i.getTensMethod or an array is used arr["integer"] // 1234 or an object where values are arrays is used o["fraction"] // .567 Having mentioned Intl.NumberFormat earlier in the thread, if the issue devoting resources to a *new *proposal, Intl.NumberFormate can be extended; e.g. a rough draft in code function formatNumberParts(args) { return Object.assign({sign:0, fraction:[0], integer:[0]}, ...args.filter(({type}) => type === "integer" || type === "fraction" || type === "minusSign").map(({type, value}) => ({[type === "minusSign" ? "sign" : type]: type !== "minusSign" ? [...value].map(Number) : -1}))); } let number = -123; let formatter = new Intl.NumberFormat('en-US'); let res = formatter.formatToParts(number); formatNumberParts(res); If the concern is that the proposal would not be useful, consider what you would *name* various uses of Math.trunc and remainder operator used at your message?