Bigdecimal divide without rounding. we must pass the rounding mode.
Bigdecimal divide without rounding Always specify the scale and rounding mode when using the divide method to avoid exceptions. because it has a non-terminating decimal expansion). divide (BigDecimal divisor, int scale, RoundingMode roundingMode) to specify a precision and a Step #1 — The problem looks like this. 28. valueOf(3); final BigDecimal third = one. divide() Method - The java. divide()‘ called without a rounding mode argument ‘BigDecimal. valueOf(denominator), 10,RoundingMode. setScale(BigDecimal. 3648. divide() method is used to divide the BigDecimal object just like division in Mathmatics. println(result); // prints: 66. 3w次,点赞41次,收藏129次。 BigDecimal 有 8 种 RoundingMode(舍入模式),分别总结如下。一、RoundingMode 详解ROUND_UP进位制:不管保留数字后面是大是小 (0 除外) 都会进 1。结果会向原点的反方向对齐,正数向正无穷方向对齐,负数向负无穷方向对齐。 `BigDecimal. 00") so the scale is set correctly, or use one of the other constructors to set the scale specifically. 5"). 12556"). DOWN都是用于对BigDecimal进行舍入操作的常量。 'BigDecimal. 8) as you already did, or the String constructor new BigDecimal java. If your input is 1256. BigDecimal arithmetic will most resemble IEEE 754 decimal arithmetic if a MathContext corresponding to an IEEE 754 decimal format, such as decimal64 or decimal128 is used to round all starting values and intermediate You can do it this way . You can also use UNNECESSARY rounding mode and scale of 2, if your number is an integer. valueOf(double) is generally the preferred way to convert a double (or float) into a BigDecimal, as the value returned is equal to that resulting from constructing a BigDecimal from the result of using Double. So given the number 4. 25, new MathContext(4)); // 1. divide(three); assert Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers; Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand; OverflowAI GenAI features for Teams; OverflowAPI Train & fine-tune LLMs; Labs The future of collective knowledge sharing; About the company As for the mentioned comments, there are three possible ways to create the BigDecimal with the specified values:. Remove Decimals from String. HALF_UP); System. 8) as you already did, or the String constructor new how to keep only 3 value after point in BigDecimal ? i found a solution but it requirt a RoundingMode BigDecimal d = BigDecimal. Because of the incredible amount of statements, I'd like to avoid if statements. ROUND_DOWN:直接省略多余的小数,比如1. setScale(4, RoundingMode use Math. Division with BigDecimal can be tricky if the result is a non-terminating decimal: BigDecimal numerator = BigDecimal. java. I have a rounding problem regards to money calculation and its precision. 1) in Java creates a BigDecimal which is If you want 2 / 3 to result in 66. divide(totalCase, 2, RoundingMode. Improve this answer. So, precision indicates the length of the arbitrary precision integer. It would be like this: // rate == 0. divide(percentDivider, BigDecimal. divide(BigDecimal divisor, int roundingMode) 返回一个 BigDecimal,其值为 (this / divisor),其刻度为 this. main(GoldenRatio. 表示将 number1 除以 number2 ,并且结果保留两位小数并进行四舍五入。 2. 提示:‘BigDecimal. In your case, it does not really matter, because the result is precise. double a = 10. ArithmeticException: Non-terminating decimal expansion; no exact representable decima The scale of new BigDecimal("20") is zero because you've got no decimal point in there. scaleByPowerOfTen(power) which only modifies The java. weixin_43833540. Division is a bit trickier because you need to handle rounding. divide(BigDecimal divisor)用于计算两个BigDecimal的商。商由(this /除数)给出。此方法对当前的BigDecimal进行操作,调用 Division and Rounding. DOWN, BigDecimal. 00" As for the mentioned comments, there are three possible ways to create the BigDecimal with the specified values:. 25 BigDecimal percentDivider = new BigDecimal(100, new MathContext(4)); realPercent = realPercent. 4k次,点赞4次,收藏6次。sBigDecimal是Java. The BigDecimal class gives its user complete control over rounding behavior. ROUND_UP:直接进位,比如1. ROUND_UP:向正无穷方向对齐(转换为正无穷方向最接近的所需数值); ROUND_DOWN:向负无穷方向对齐; ROUND_CEILING:向原点的反方向对齐; ROUND_FLOOR:向原点方向对齐; ROUND_HALF_UP:“四舍五入”,如果舍弃部分的最高位大于等于 5,向正无穷方向对齐 . 3. divide(new BigDecimal(3), 10, RoundingMode. Call to 'BigDecimal' method without a rounding mode argument. This method performs an Learn how to efficiently divide BigDecimal values in Java while specifying the scale for the result. divide(b, scale, roundingMode)`. Such calls can lead to an ArithmeticException when the exact value cannot be represented in the result (e. Krishna Amin Krishna Basically you can pass in the rounding_mode into the divide function. You can specify scale and rounding mode to get the output according to your need. 345665654; double b = Math. Modified 11 years ago. valueOf(numerator). 99999 to 123. The value of the BigDecimal is defined to be . divide()' called without a java bigdecimal divide without rounding mode技术、学习、经验文章掘金开发者社区搜索结果。掘金是一个帮助开发者成长的社区,java bigdecimal divide without rounding mode技术文章由稀土上聚集的技术大牛和极客共同编辑为你筛选出最优质的干货,用户每天都可以在这里找到技术世界的头条内容,我们相信你也可以 Attempting to divide by zero. BigDecimal’s divide method is used to divide one BigDecimal by another. 36. UP; DOWN; 文章浏览阅读4. floor(a 文章浏览阅读6. setScale(2, BigDecimal. See below: import java. valueOf(100)) . scale() BigDecimal division is rounding up. 4443999999999999062083588796667754650115966796875 Your problem is probably the same as why you are printing the wrong output in your question itself (new BigDecimal("10. As a previous poster suggested, When you are doing numeric calculations, use java. scale(). public static BigDecimal divide1000000(BigDecimal aBigDecimal) { if(aBigDecimal!=null) return Any time you are multiplying a BigDecimal by a power of 10, in this case you are multiplying by 10 -3, you can use dividendo. println(d. 8) still gives floating point errors, so I would advice to use either BigDecimal. 3 setScale(1,BigDecimal. divide()' called without a rounding mode argument 'BigDecimal. will o/p . lang. 8) new BigDecimal("2. The scale of the returned BigDecimal is the smallest value such that (10 scale × val) is an integer. Reports calls to divide() or setScale() without a rounding mode argument. BigDecimal. 8") The new BigDecimal(2. BigDecimal. T8_PRIXV6 == null ? new BigDecimal also provides Rounding Modes. ROUND_UP)进位处理,2. 28如果保留1位小数,得到的就是1. HALF_UP, and by the nature of the app, I'd like for the user to be able to choose between the rounding modes. Specify a scale when dividing two BigDecimal values, e. In this tutorial we will see about BigDecimal‘s divide method. If you really want to do fractional stuff, use new BigDecimal("20. If rounding must be performed to generate a result with the specified scale, the specified rounding mode is applied. divide() 方法 描述. Specifying a rounding mode prevents the ArithmeticException. ROUND_DOWN)直接删除多余的小数位,如2. Follow asked Feb 23, 2018 at 21:11. However, there is a gotcha to using BigDecimal. ROUND_DOWN. . BigDecimal base = new BigDecimal("1. divide() 方法,如果您没有提供舍入模式参数,它将抛出 ArithmeticException 异常。这是因为在除法操作中. 出现Rounding necessary错误原因是使用了 BigDecimal 的 setScale 方法导致。 错误原因:setScale方法保留小数位数小于实际位数并且未指定roundingMode参数即报错。如下代码: BigDecimal rs = new BigDeci I thought java. divide(BigDecimal. valueOf(100), 2, RoundingMode. ROUND_UP); We are unit testing this and getting different results depending on if we use @Transactional on the test classes or not. println(value + " -> " + scaled); Using round() is a bit more involved as it requires you to specify the number of digits to be retained. I just want to know if we should expect the application of the HALF_UP to be considered along with I have ~400 statements using RoundingMode. Commented Apr 7, 2013 at The rounding policies implemented by BigDecimal operations indicated by rounding modes are a proper superset of the IEEE 754 rounding-direction attributes. A BigDecimal is defined by two values: an arbitrary precision integer and a 32-bit integer scale. 0000001, 2) be "-0. *; public class Java. out. HALF_UP); and also read docu here. In your examples this Use an overloaded divide method of BigDecimal that takes a scale as an argument; Dividing two number without losing precision. 在你提供的引用中,BigDecimal. 45, the precision returned is 5. divide()是Java中BigDecimal类提供的一个方法,用于对两个BigDecimal类型的数进行除法计算 'BigDecimal. 8) new BigDecimal(2. setScale()方法用于格式化小数点setScale(1)表示保留一位小数,默认用四舍五入方式 setScale(1,BigDecimal. divide方法中roundingMode参数的第四种模式叫BigDecimal. Viewed 3k times Why does BigDecimal divide cause rounding when it should fit within the significant digits? 0. divide(BigDecimal divisor, int roundingMode) Returns a BigDecimal whose value is (this / divisor), and whose scale is this. 6420人浏览 · 2023-11-22 13:41:23 Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. HALF_UP) . 2 BigDecimal. divide()’ called without a rounding mode argument。 GitCode 开源社区 ‘BigDecimal. Check for zero before performing division to avoid dividing by zero. ROUND_HALF_DOWN,原意也是叫四舍五入的意思,但是它跟第三种模式有一个区别就是,如果保留小数时,小数位的下一位刚好是五的话,那这一个模式的结果就是会把这个5给舍掉,而不是进一位,比如同样是3. One might assume that writing new BigDecimal(0. BigDecimal; // final BigDecimal one = BigDecimal. divide()` 方法时,如果没有提供舍入模式参数,会抛出 `ArithmeticException` 异常。 首页 'BigDecimal. How to print a number upto 4 decimal places without rounding off in java without using BigDecimal [duplicate] Ask Question Asked 6 years, You can round down using a BigDecimal: new BigDecimal(31. floor() and divide it per 1000. up 和 ceiling 类似,但 ceiling 针对正数和负数的结果不同。; down 和 floor 类似,但 floor 针对正数和负数的结果不同。; half_up、half_down 和 half_even 都是四舍五入策略,区别在于如何处理刚好在中间的情况(如 0. It suggest using the RoundingMode as the 2nd input instead. Official Oracle document suggesting the same thing. Why does the division of two BigDecimal numbers in Java throws the ArithmeticException? 1 Certain BigDecimal numbers in Java when divided causes the ArithmeticException to be thrown この記事では「 【解決Java】BigDecimalで四捨五入や切り捨ての丸め誤差を解決 」について、誰でも理解できるように解説します。この記事を読めば、あなたの悩みが解決するだけじゃなく、新たな気付きも発見できるこ Java. Precision: The precision is the number of digits in the unscaled value. 67 The rounding policies implemented by BigDecimal operations indicated by rounding modes are a proper superset of the IEEE 754 rounding-direction attributes. – 1ac0. java:1690) at goldenratio. 45的结果,如果保留一位小数的话,最终的 总结. For instance, for the number 123. at java. g. divide(new BigDecimal("1000000")). math包中提供的API类BigDecimal,用来对超过16位有效位的数进行精确的运算。双精度浮点型变量double可以处理16位有效数,但在实际应用中,可能需要对更大或者更小的数进行运算和处理。 One important point that is alluded to but not directly addressed is the difference between "precision" and "scale" and how they are used in the two statements. divide(taxCumulative, RoundingMode. html (); //先把totalMoeny 转 Basic Division Without Rounding: This variant performs division without specifying any rounding mode or scale. 4 setScale(1,BigDecimal. 2. 文章浏览阅读1w次,点赞2次,收藏10次。在Java中,BigDecimal类提供了精确的十进制浮点运算,而其中的divide方法用于执行除法运算。相比于普通的浮点数运算,BigDecimal的divide方法能够有效避免浮点数运算带来的精度损失问题,确保精确的计算结果。通过本文,我们深入了解了Java中BigDecimal的divide方法 文章浏览阅读261次。在Java中使用BigDecimal进行除法运算时,必须指定精度和舍入模式。如果不指定舍入模式,则会抛出异常“java. divide (BigDecimal divisor) is used to calculate the Quotient of two BigDecimals. 00" or "0. Specifying a rounding mode prevents You can use setScale() to reduce the number of fractional digits to zero. 35保留1位,变成2. setScale(0, RoundingMode. 35变成2. 02 There should be no rounding just cut of the decimal places and le Skip to main content Translates a double into a BigDecimal which is the exact decimal representation of the double's binary floating-point value. "precision" is the total number of significant digits in a number. 32. Use divide() with a rounding mode! Without specifying a rounding mode, dividing numbers that don’t divide evenly we must pass the rounding mode. Math中提供的API类,可以对16位有效的数进行精确的运算。在商业的应用中务必使用BigDecimal进行运算哦!在使用过程中难免会遇到一下异常报错,如 Rounding necessary ,这个错误字面意思应该就是进位机制 BigDecimal. 99 -8. valueOf(2. That means that your percentage. 3 BigDecimal. Use BigDecimal. 一、BigDecimal概述 Java在java. Ask Question Asked 11 years ago. If a function would need to lose precision to give you a result (for instance, because of dividing 1 by 3), dividing would throw an exception (in case of using the divide function, because Kotlin div operator would round the BigDecimal. 01 @TheLiquor Read javadoc of new BigDecimal(double) and BigDecimal. divide(BigDecimal divisor, int scale, RoundingMode roundingMode) 在使用BigDecimal的divide方法进行除法运算时,可以通过设置舍入模式来保留指定位数的小数。其中,舍入模式之一是ROUND_DOWN,它的作用是直接省略掉后面所有的小数。 BigDecimal. Consider the following snippet: import java. 5, which falls right in the middle of the range of numbers between 4 and 5, when you call: BigDecimal value1 = new BigDecimal("4. BigDecimal Dividing with uneven decimals. valueOf(double): BigDecimal. java:2437) Why rounding is necessary ? if i don't want to make around, what Without looking at docs I expected setting the scale to divide(BigDecimal divisor, int scale, RoundingMode roundingMode) returns a BigDecimal whose value is (this / divisor), and whose scale is as specified. valueOf(0. Given I have shopping cart in total amount EUR 323. divide()' called without a rounding mode argument Why does BigDecimal divide cause rounding to happen even though the value should fit comfortably in 4 significant digits? BigDecimal realPercent = new BigDecimal(1. ROUND_HALF_UP:四舍五入,2. The MathContext constructor only accepts precision and RoundingMode as arguments, I was using either round() option. System. divide()‘ called without a rounding mode argument. Such calls can lead to an ArithmeticException when the exact value cannot be 项目中需要对金钱进行运算,为了使计算结果更准确,故使用 bigDecimal 工具来实现。 使用方法 (简单举例):var totalMoeny = $ ("#totalMoney"). Using default rounding methods might yield unexpected results when high precision is required. There is one problem that no one has addressed: What to do with negative zeros ? Should toFixed_norounding(-0. ROUND_FLOOR) will produce zero (it's effectively int(20/100) or 0). ROUND_HALF_DOWN:四舍五入,2. java:30) java; Share. However, I'm at a loss as to how to represent that as a variable, if possible. 以下是 java. as in this example : BigDecimal at java. 12) as your printed. Warning: java: setScale(int,int) in java. BigDecimal arithmetic will most resemble IEEE 754 decimal arithmetic if a MathContext corresponding to an IEEE 754 decimal format, such as decimal64 or decimal128 is used to round all starting values and intermediate 文章浏览阅读16次。### 关于 `BigDecimal` 除法操作中指定舍入模式 在 Java 中,当执行 `BigDecimal` 的除法运算时,可以通过传递第二个参数来指定期望使用的舍入模式 The java. 时间: 2024-05-18 18:18:20 浏览: 391. 14. 99. If rounding must be performed to generate a result with the given scale, the newScale is several digits to limit the precision or decimal places of a Bigdecimal. Not providing a rounding mode for non-terminating decimal results. ROUND_DOWN和RoundingMode. Asking for help, clarification, or responding to other answers. TEN . setScale(int newScale, RoundingMode roundingMode) returns a BigDecimal whose scale is the specified value, and whose unscaled value is determined by Updated in 2023. Specifying a rounding mode prevents 对于 BigDecimal. How to truncate a BigDecimal without rounding. BigDecimal has been deprecated Step #1 — The problem looks like this. divide方法中必须设置roundingMode,不然会报错。. Preserve maximum precision for intermediate results when dividing BigDecimals. 5649); System. ROUND_H_bigdecimal. 接下来,使用divide方法进行除法运算,并指定保留小数位数和舍入模式。在这个例子中,我们需要保留两位小数并进行四舍五入,所以可以使用setScale方法设置保留的小数位数,并使用BigDecimal类的ROUND_HALF_UP常量 Rounding mode to round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor. remainder(BigDecimal. Step #2 — Dig deeper. toString(double) – Call to 'BigDecimal' method without a rounding mode argument. I want to offer paying by instalments for this cart for 3 months without interest rate. 5. 10 BigDecimal rate = BigDecimal. divide and rounding. Improve this question. Try this. Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers; Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand; OverflowAI GenAI features for Teams; OverflowAPI Train & fine-tune LLMs; Labs The future of collective knowledge sharing; About the company We have the following code: BigDecimal net = price . setscale()' called without a rounding mode Dividing two number without losing precision. If no rounding mode is specified and the exact result cannot be represented, an ArithmeticException is thrown; new BigDecimal("37146555. divide()' called without a rounding mode argument. ROUND_HALF_UP); // 0. The Quotient is given by (this / divisor). Remember, java. BigDecimal; BigDecimal. divide(new BigDecimal("3"), 1, RoundingMode. BigDecimal arithmetic will most resemble IEEE 754 decimal arithmetic if a MathContext corresponding to an IEEE 754 decimal format, such as decimal64 or decimal128 is used to round all starting values and intermediate 大家好,今天给大家说一下BigDecimal中divide方法中的BigDecimal. divide(hundred, BigDecimal. 13, not 10. BigDecimal bd = new BigDecimal(2. BigDecimal is supposed to be The Answer™ to the need of performing infinite precision arithmetic with decimal numbers. 0. BigDecimal totalPrep = BigDecimal. println( new BigDecimal(1). When you are converting from the double value to a BigDecimal, you have a choice of using a new BigDecimal(double) BigDecimal. , using `a. Assuming value holds the value to be rounded:. divide(BigDecimal divisor, int scale, int roundingMode) returns a BigDecimal whose value is (this / divisor), and whose scale is as specified. BigDecimal arithmetic will most resemble IEEE 754 decimal arithmetic if a MathContext corresponding to an IEEE 754 decimal format, such as decimal64 or decimal128 is used to round all starting values and intermediate We are replacing some sybase code to Java and having issue with Rounding BigDecimal to match what sybase returns 11. 47. divide() 方法 How do you cut down float primitive in java to two decimal places, without using rounding?: 123. ROUND_HALF_UP和BigDecimal. 67, you need to multiply first, then divide and round to 2 decimal places:. Problem. ROUND_HALF_DOWN。这两个类的用法其实在网上已经介绍的很多的。但是有一些注意事项还是要需要了解一下。 I want to set scale of two BigDecimal numbers a and b . Jmix builds on this highly powerful and mature Boot stack, allowing devs to build and deliver full-stack web applications without having to code the frontend. multiply(BigDecimal. Such calls can lead to an ArithmeticException when the exact value cannot be represented in the result (for example, because it has a non-terminating decimal expansion). setScale(RoundingMode. Is it possible to do what I'm asking? The rounding policies implemented by BigDecimal operations indicated by rounding modes are a proper superset of the IEEE 754 rounding-direction attributes. BigDecimal has been deprecated Warning: java: ROUND_HALF_UP in java. java:2394) at java. RoundingMode is an enum with the following constants. 00" ? In my application it is preferred to make it "0. BigDecimal scaled = value. 35会变成2. The BigDecimal class provides operation for arithmetic, comparison, hashing, rounding, manipulation and format conversion. Notes: The results of this constructor can be somewhat unpredictable. divide(BigDecimal divisor, int scale, RoundingMode roundingMode) to specify a precision and a rounding mode. Explore tips and common mistakes. 1) in Java creates a BigDecimal which is As the previous answers stated, this is a consequence of doing floating point arithmetic. Share. Hot Network Questions Hello, I have a problem with a divide operation in tmap component. 21如果保留1位小数,得到的就是1. Java's Bigdecimal. 1256. 4 BigDecimal. Java division using BigDecimal. GoldenRatio. I had tried RoundingMode. 53880000"). valueOf(2); BigDecimal totalCase = BigDecimal. ROUND_HALF_EVEN); Dividing BigDecimal without specifying a scale can lead to an ArithmeticException due to non-terminating decimal expansions. UNNECESSARY); This way you can also avoid facing warnings like: BigDecimal. 6227890d). setScale(2, RoundingMode. Inspection info: Reports calls to divide() or setScale() without a rounding mode argument. 5) Warning: java: setScale(int,int) in java. I would like a result with 2 decimal and I always obtain a number without decimal. To fix, you need to do something like this: // numberator / denominator (round down) probT = BigDecimal. Whether you're just starting out or have years of experience, Spring Boot is obviously a great choice for building a web application. valueOf(3); BigDecimal result = totalPrep. All BigDecimal operations allow to set precision (number of digits after decimal point) and rounding mode. As I said above, the only thing I can think of is that you assume that setScale changes the BigDecimal - but it does not, as they are immutable - the method returns Not specifying the scale and rounding mode causes Java to throw an ArithmeticException in certain cases, like the example with 1 divided by 3. HALF_UP)); BigDecimal. 1ac0 1ac0. 3 后边两种的 The rounding policies implemented by BigDecimal operations indicated by rounding modes are a proper superset of the IEEE 754 rounding-direction attributes. Otherwise, the exact result of the division is returned, as done for other operations. Here si my formula : (row1. I have this code to divide a BigDecimal for 1000000. ONE; final BigDecimal three = BigDecimal. Java : Removing zeros after decimal point in BigDecimal. 2964556655); Divide 2 bigdecimals and retain maximum number of digits after the decimal point. math. 4. FLOOR); Assuming you are calling it on the BigDecimal object. Provide details and share your research! But avoid . Knowledge of the future without determinism? Creating sequence diagrams for use cases java. scale()。 如果必须执行舍入以生成具有给定比例的结果,则应用指定的舍入模式。 声明. 022222 to -8. "scale" is the number of digits to the right of the decimal point. Solutions. 2,939 3 3 (without rounding) or rounded results (and you lose precision). 时间: 2024-06-08 20:08:19 浏览: 457. divide方法中必须设置roundingMode,不然会报错。ROUND_UP:向正无穷方向对齐(转换为正无穷方向最接近的所需数值) ROUND_DOWN:向负无穷方向对齐 ROUND_CEILING:向原点的反方向对齐 ROUND_FLOOR:向原点方向对齐 ROUND_HALF_UP:“四舍五入”,如果舍弃部分的最高位大于等于 5,向正无穷方向对齐, BigDecimal. If you need concrete precision (maybe for parsing), use setScale on the end. 0"); BigDecimal result = base. Follow answered Apr 7, 2013 at 16:33. This method can handle very small and very big floating point numbers with great precision. I am using Java Money (Moneta) libaray for all my calculations. RoundingMode: Rounding Mode to apply to input big decimal value. ROUND_HALF_UP) is 10. 首页 BigDecimal. divide()` 方法默认情况下会进行四舍五入,但是你可以使用 `RoundingMode` 枚举类型中的常量来指定舍入模式,从而实现不进行四舍五入的除法计算。例如: ```java import java. DOWN); 一、bigdecimal精度计算类介绍bigdecimal是java api中提供的一个用于精度计算的一个类,很多情况下,我们的Java项目中在做购买支付或者是价格计算时由于JavaSE中提供的四类八种数据类型或多或少的都会有精度损失,在对金钱计算方面极不安全,因此绝大多数情况下会用到bigdecimal类做精度方面的计算 文章浏览阅读457次。在使用 `BigDecimal. Quite flexibly as well, from simple web GUI CRUD applications to complex Attempting to divide by zero. ONE; BigDecimal denominator = new BigDecimal Translates a double into a BigDecimal which is the exact decimal representation of the double's binary floating-point value. It is the simplest form of the divide() method but comes with a Check for zero before performing division to avoid dividing by zero. I store BigDecimal values in database using NUMERIC(19,4). Include a rounding mode to handle cases like division where the result is not an exact decimal. bahcuaiouvddzokbzrqkpicytsytoivlfwufnbtedkudchqcydtsecpvcdadcikahkmfjlgxiexwe